@qitqode/qitqode-android-arm64 0.1.35 → 0.1.36
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-7311jry1.js → chunk-00sr2gwz.js} +2 -2
- package/bundle/{chunk-azhw650z.js → chunk-02xcb52z.js} +2 -2
- package/bundle/{chunk-gws1rn1v.js → chunk-08q55ya0.js} +1 -1
- package/bundle/chunk-092bx2yw.js +2 -0
- package/bundle/{chunk-xgr6jnd6.js → chunk-0g25z230.js} +1 -1
- package/bundle/chunk-0j6dhrew.js +2 -0
- package/bundle/chunk-0jrgk6vk.js +2 -0
- package/bundle/chunk-0qn52zsd.js +2 -0
- package/bundle/chunk-10accb7b.js +2 -0
- package/bundle/{chunk-t3eymzg1.js → chunk-132tcp2j.js} +2 -2
- package/bundle/chunk-13kpdfr7.js +2 -0
- package/bundle/chunk-15s8zwgf.js +2 -0
- package/bundle/{chunk-nj4d554m.js → chunk-1bx2sjn6.js} +1 -1
- package/bundle/chunk-1kgyfja6.js +2 -0
- package/bundle/{chunk-bv29k2pf.js → chunk-1mcsf4yb.js} +2 -2
- package/bundle/{chunk-kwx9ewe0.js → chunk-1wpjmwnh.js} +1 -1
- package/bundle/chunk-1yv5h8k4.js +2 -0
- package/bundle/chunk-24rw1br0.js +3 -0
- package/bundle/{chunk-snr44en9.js → chunk-25bp7pcm.js} +2 -2
- package/bundle/{chunk-kmcsz8yv.js → chunk-2dkrfc1s.js} +1 -1
- package/bundle/chunk-364ccew0.js +3 -0
- package/bundle/{chunk-aa8hymcv.js → chunk-37dvnent.js} +2 -2
- package/bundle/chunk-3bkdbqjj.js +2 -0
- package/bundle/chunk-3bnqw3xp.js +3 -0
- package/bundle/{chunk-08m0hkdz.js → chunk-3dr4469n.js} +1 -1
- package/bundle/{chunk-hv6eccx1.js → chunk-3gw6r3hf.js} +179 -179
- package/bundle/{chunk-n96tvjgj.js → chunk-3mepk08v.js} +2 -2
- package/bundle/chunk-3sz6gw10.js +3 -0
- package/bundle/chunk-41x11r2s.js +3 -0
- package/bundle/{chunk-xqdrr7xg.js → chunk-45mjcxqk.js} +1 -1
- package/bundle/{chunk-qrtc3etn.js → chunk-4fa390yr.js} +2 -2
- package/bundle/chunk-4gs87ghj.js +3 -0
- package/bundle/chunk-4kqdzdv5.js +3 -0
- package/bundle/{chunk-3k2b05fv.js → chunk-4sazy0nq.js} +1 -1
- package/bundle/chunk-4tbqsrsn.js +2 -0
- package/bundle/{chunk-ngccf7ga.js → chunk-52b1v7mn.js} +1 -1
- package/bundle/chunk-53kns5wy.js +2 -0
- package/bundle/{chunk-11v7vz3y.js → chunk-549ptbaj.js} +1 -1
- package/bundle/chunk-559ek1ym.js +2 -0
- package/bundle/{chunk-34p46th6.js → chunk-5bate758.js} +1 -1
- package/bundle/{chunk-kdcnder5.js → chunk-5kmfnkzv.js} +1 -1
- package/bundle/{chunk-w1n4rf6n.js → chunk-5pkg052s.js} +2 -2
- package/bundle/chunk-5yfzzmv0.js +2 -0
- package/bundle/{chunk-rsszcqxd.js → chunk-60qyqqxx.js} +1 -1
- package/bundle/{chunk-94pcpztx.js → chunk-64s7vfj7.js} +2 -2
- package/bundle/{chunk-bzgj60w4.js → chunk-6sfhbckv.js} +1 -1
- package/bundle/{chunk-8762ty72.js → chunk-70pb4kcm.js} +2 -2
- package/bundle/{chunk-04hvaaje.js → chunk-72zxassf.js} +1 -1
- package/bundle/{chunk-yz6898wy.js → chunk-73ckx171.js} +1 -1
- package/bundle/chunk-7cbj28fp.js +2 -0
- package/bundle/chunk-7dep7g7c.js +2 -0
- package/bundle/{chunk-gj0wt0cy.js → chunk-7fawtcnn.js} +1 -1
- package/bundle/{chunk-zfn0z4sh.js → chunk-7gbytqkn.js} +2 -2
- package/bundle/{chunk-x66ycpfs.js → chunk-7jhrxzjx.js} +2 -2
- package/bundle/{chunk-09pkckr1.js → chunk-7vftsy04.js} +1 -1
- package/bundle/{chunk-zfd70p01.js → chunk-8dxdeksr.js} +1 -1
- package/bundle/{chunk-6styp5dn.js → chunk-8fgamz4y.js} +1 -1
- package/bundle/{chunk-9qdr9t8c.js → chunk-8q6z6emx.js} +1 -1
- package/bundle/{chunk-4ttf9rjd.js → chunk-8r3410c2.js} +1 -1
- package/bundle/{chunk-3mzcr3fw.js → chunk-8tp4whyw.js} +1 -1
- package/bundle/chunk-8yn64y27.js +2 -0
- package/bundle/{chunk-41v0x1jk.js → chunk-8yr682pv.js} +2 -2
- package/bundle/chunk-8ywa7az5.js +2 -0
- package/bundle/chunk-8ywdddts.js +2 -0
- package/bundle/chunk-8zmreqxx.js +2 -0
- package/bundle/chunk-92zjark4.js +2 -0
- package/bundle/chunk-983rqajz.js +7 -0
- package/bundle/{chunk-kjyw00jp.js → chunk-9cw4cnz0.js} +1 -1
- package/bundle/{chunk-2swch6mx.js → chunk-9dh9bc9d.js} +1 -1
- package/bundle/{chunk-y437vyza.js → chunk-9fkmhmh6.js} +1 -1
- package/bundle/{chunk-7vd91wsd.js → chunk-9nk0ts0s.js} +1 -1
- package/bundle/{chunk-p9cnzxb8.js → chunk-9s4whpg1.js} +2 -2
- package/bundle/{chunk-yajd975f.js → chunk-9xvctnjr.js} +1 -1
- package/bundle/chunk-9yakc5yv.js +28 -0
- package/bundle/{chunk-4wxxyrxn.js → chunk-9zre5e54.js} +1 -1
- package/bundle/chunk-a42q5mx4.js +3 -0
- package/bundle/{chunk-yt3f3j35.js → chunk-a9y27zd2.js} +1 -1
- package/bundle/{chunk-mex0fe9s.js → chunk-acyj91wq.js} +1 -1
- package/bundle/chunk-aq28ejhv.js +2 -0
- package/bundle/{chunk-pkc4ddw1.js → chunk-atpzz901.js} +1 -1
- package/bundle/chunk-ax1y4699.js +2 -0
- package/bundle/{chunk-dctj3c22.js → chunk-b0jh0rby.js} +2 -2
- package/bundle/chunk-b0x888w9.js +2 -0
- package/bundle/chunk-b10px5g4.js +2 -0
- package/bundle/chunk-b1qhpxee.js +2 -0
- package/bundle/chunk-b4ysd5b4.js +9 -0
- package/bundle/chunk-bcs2gvmp.js +2 -0
- package/bundle/{chunk-7mxt5b0h.js → chunk-bjcb9kt0.js} +1 -1
- package/bundle/{chunk-67d5d8mr.js → chunk-bnz0mxak.js} +1 -1
- package/bundle/{chunk-er38zew1.js → chunk-brh35yt5.js} +2 -2
- package/bundle/chunk-bs020a3x.js +2 -0
- package/bundle/{chunk-7eexey82.js → chunk-c72jajx9.js} +1 -1
- package/bundle/{chunk-81trveht.js → chunk-cagk1sjd.js} +1 -1
- package/bundle/{chunk-1byd3wma.js → chunk-cdh26622.js} +2 -2
- package/bundle/chunk-cjxcnhmq.js +14 -0
- package/bundle/{chunk-zddknkw7.js → chunk-cx0j6mpq.js} +1 -1
- package/bundle/{chunk-zh3fny3z.js → chunk-cx7p4ezk.js} +2 -2
- package/bundle/chunk-d0xs3j5h.js +2 -0
- package/bundle/{chunk-pxmhe36r.js → chunk-d1rn44wz.js} +1 -1
- package/bundle/chunk-d72rty3t.js +2 -0
- package/bundle/{chunk-0c6ep9mc.js → chunk-d93z6hrn.js} +1 -1
- package/bundle/{chunk-seghf5fc.js → chunk-dgx4rq86.js} +1 -1
- package/bundle/{chunk-qzj6027k.js → chunk-dh1h513y.js} +1 -1
- package/bundle/chunk-dj951pms.js +2 -0
- package/bundle/chunk-dp6zktka.js +2 -0
- package/bundle/{chunk-ba3h1pzs.js → chunk-dshnn54c.js} +1 -1
- package/bundle/{chunk-73myw3bj.js → chunk-dt899wbf.js} +2 -2
- package/bundle/chunk-dvqdtdza.js +2 -0
- package/bundle/{chunk-6ynxf3q7.js → chunk-dvxk6mr6.js} +2 -2
- package/bundle/chunk-dx7h5r8j.js +2 -0
- package/bundle/{chunk-bnss5dkk.js → chunk-dykqn0nj.js} +2 -2
- package/bundle/chunk-e03tgfpb.js +8 -0
- package/bundle/chunk-e07dbha4.js +2 -0
- package/bundle/chunk-e88wd9ex.js +2 -0
- package/bundle/{chunk-y9zstzed.js → chunk-eaqfnwdj.js} +1 -1
- package/bundle/chunk-ebabnv33.js +3 -0
- package/bundle/chunk-ebdpg3cn.js +2 -0
- package/bundle/{chunk-8vg4fmg2.js → chunk-ebkztnpf.js} +180 -178
- package/bundle/chunk-ec7pznsp.js +2 -0
- package/bundle/chunk-et7kz7kx.js +2 -0
- package/bundle/{chunk-kfmz2p27.js → chunk-ev3a2sxv.js} +2 -2
- package/bundle/{chunk-d00c1k9w.js → chunk-ewpzqnj4.js} +1 -1
- package/bundle/chunk-eyc6tb5h.js +2 -0
- package/bundle/chunk-eywryd3k.js +2 -0
- package/bundle/chunk-eze57bty.js +2 -0
- package/bundle/{chunk-qddt2gcs.js → chunk-ezrskm25.js} +1 -1
- package/bundle/chunk-f36ctnbp.js +3 -0
- package/bundle/{chunk-9ayxg9mq.js → chunk-f77nxt23.js} +2 -2
- package/bundle/chunk-fa47vzfc.js +2 -0
- package/bundle/chunk-fe397ph0.js +2 -0
- package/bundle/chunk-fjm9kstr.js +5 -0
- package/bundle/{chunk-exmw8jfa.js → chunk-fmxm4kaj.js} +2 -2
- package/bundle/chunk-fr75ytdr.js +2 -0
- package/bundle/chunk-fw2tnbt6.js +2 -0
- package/bundle/chunk-fwr2qgqb.js +2 -0
- package/bundle/chunk-g204pt98.js +2 -0
- package/bundle/chunk-g5prcvq2.js +14 -0
- package/bundle/{chunk-ggydr1ze.js → chunk-g794ey6w.js} +1 -1
- package/bundle/chunk-gcgmwqhh.js +2 -0
- package/bundle/{chunk-rmve21dh.js → chunk-gg7bg3ek.js} +1 -1
- package/bundle/{chunk-9x25d115.js → chunk-gkj4a27z.js} +1 -1
- package/bundle/chunk-gvtjxg0d.js +2 -0
- package/bundle/chunk-gw36mrg4.js +2 -0
- package/bundle/{chunk-z8gdmvgg.js → chunk-gwfx7tx7.js} +2 -2
- package/bundle/{chunk-q8hd01j7.js → chunk-gxmxx8jb.js} +1 -1
- package/bundle/{chunk-tge53d52.js → chunk-h1kg35mn.js} +1 -1
- package/bundle/chunk-h36qec67.js +2 -0
- package/bundle/{chunk-0msqaywp.js → chunk-h7w35n7w.js} +1 -1
- package/bundle/chunk-h9gtymfm.js +2 -0
- package/bundle/chunk-h9qn35pn.js +2 -0
- package/bundle/{chunk-mr8j7rc6.js → chunk-hb9mc5f9.js} +1 -1
- package/bundle/{chunk-5a7fs1hg.js → chunk-hbh2034m.js} +1 -1
- package/bundle/{chunk-df2aswz3.js → chunk-hcy77w6t.js} +1 -1
- package/bundle/{chunk-6a7c7wnf.js → chunk-hgsykghj.js} +2 -2
- package/bundle/chunk-hhjkezfz.js +2 -0
- package/bundle/chunk-hnz570f9.js +3 -0
- package/bundle/{chunk-tbgczapt.js → chunk-htkwc2se.js} +2 -2
- package/bundle/chunk-j21dnncc.js +4 -0
- package/bundle/{chunk-1yt5rsew.js → chunk-j63fkt6n.js} +1 -1
- package/bundle/chunk-ja18tvc7.js +2 -0
- package/bundle/{chunk-03xppy47.js → chunk-jcjaw7tk.js} +2 -2
- package/bundle/{chunk-jkh6eg7d.js → chunk-jf6ry79j.js} +4 -4
- package/bundle/{chunk-ke7n9t5p.js → chunk-jgz1a29w.js} +3 -3
- package/bundle/{chunk-ebcdxmdd.js → chunk-jngchw38.js} +1 -1
- package/bundle/{chunk-j5ymkhry.js → chunk-jqn27885.js} +1 -1
- package/bundle/chunk-jr2q5295.js +3 -0
- package/bundle/{chunk-hj3ddt53.js → chunk-jts0dma5.js} +2 -2
- package/bundle/chunk-jw16f6t0.js +4 -0
- package/bundle/chunk-jxg15t11.js +2 -0
- package/bundle/{chunk-7hm0c2yg.js → chunk-kqhh2pm9.js} +1 -1
- package/bundle/{chunk-0h8wdch6.js → chunk-kt0ej3nq.js} +1 -1
- package/bundle/chunk-kwzawx7r.js +2 -0
- package/bundle/{chunk-n6msxne8.js → chunk-kx2dp8ch.js} +1 -1
- package/bundle/chunk-m0mek3es.js +2 -0
- package/bundle/chunk-m31d2n6h.js +2 -0
- package/bundle/{chunk-egn55fa2.js → chunk-mcc5ynma.js} +3 -3
- package/bundle/{chunk-md8161zd.js → chunk-mdzzcrf9.js} +2 -2
- package/bundle/{chunk-gckgaqqr.js → chunk-mqtqcc10.js} +2 -2
- package/bundle/{chunk-ynwkr3yh.js → chunk-mvnxwwe7.js} +2 -2
- package/bundle/{chunk-6a77w77q.js → chunk-mvsrzvc4.js} +4 -4
- package/bundle/{chunk-b4knxpqh.js → chunk-mw2hr4pd.js} +1 -1
- package/bundle/{chunk-vszbqv24.js → chunk-mzbr0m2v.js} +1 -1
- package/bundle/{chunk-bj00xk8k.js → chunk-n0trgp1c.js} +2 -2
- package/bundle/chunk-n14qktbg.js +2 -0
- package/bundle/{chunk-yjk6zv2z.js → chunk-n2ygpy76.js} +1 -1
- package/bundle/{chunk-54wh8b12.js → chunk-n7xgfm5x.js} +2 -2
- package/bundle/{chunk-06k6egt2.js → chunk-neqy8j4n.js} +1 -1
- package/bundle/{chunk-nj61v4n7.js → chunk-njkserae.js} +1 -1
- package/bundle/{chunk-n6gtdx5h.js → chunk-nq495be3.js} +1 -1
- package/bundle/chunk-nr4q9fv7.js +2 -0
- package/bundle/{chunk-p3qkexpk.js → chunk-nsjp44fp.js} +1 -1
- package/bundle/chunk-nzzsj54n.js +2 -0
- package/bundle/chunk-p19qfw59.js +2 -0
- package/bundle/chunk-p2yxj9s4.js +2 -0
- package/bundle/{chunk-1dtzxt2w.js → chunk-p3rp99na.js} +1 -1
- package/bundle/chunk-p8czsxp0.js +3 -0
- package/bundle/chunk-p8k48st6.js +5 -0
- package/bundle/{chunk-79agp7v3.js → chunk-p8kpqyxb.js} +2 -2
- package/bundle/{chunk-9fxkh84w.js → chunk-p9zrk16q.js} +1 -1
- package/bundle/{chunk-6ged58yw.js → chunk-pmv8yr8c.js} +2 -2
- package/bundle/{chunk-ee23d2nz.js → chunk-pnq1h5az.js} +2 -2
- package/bundle/chunk-pq3qwxa8.js +2 -0
- package/bundle/{chunk-wfd5h6ax.js → chunk-pqnbdygz.js} +2 -2
- package/bundle/chunk-ps9p14y6.js +2 -0
- package/bundle/{chunk-zfcp509b.js → chunk-pxx2hz0g.js} +2 -2
- package/bundle/{chunk-txbwmwxj.js → chunk-q7rt76qw.js} +1 -1
- package/bundle/{chunk-rq4w0by4.js → chunk-q81m4m9z.js} +1 -1
- package/bundle/chunk-qagc6v17.js +2 -0
- package/bundle/{chunk-mq6jn47r.js → chunk-qb35hqm4.js} +1 -1
- package/bundle/chunk-qc0zhbhm.js +2 -0
- package/bundle/{chunk-keveg5gx.js → chunk-qdcf1ay5.js} +2 -2
- package/bundle/chunk-qp9y0g73.js +3 -0
- package/bundle/chunk-qpd0gab8.js +2 -0
- package/bundle/{chunk-axdzm75h.js → chunk-qqne79vp.js} +2 -2
- package/bundle/{chunk-g4gjz7sq.js → chunk-qs4wef8c.js} +1 -1
- package/bundle/chunk-r0ewmh6f.js +2 -0
- package/bundle/chunk-r3df289z.js +2 -0
- package/bundle/{chunk-by855es0.js → chunk-r58gzg6m.js} +1 -1
- package/bundle/{chunk-fmq0m4k5.js → chunk-r6ndvzd0.js} +1 -1
- package/bundle/chunk-r78kfhvz.js +2 -0
- package/bundle/{chunk-dyv2hqvc.js → chunk-rcyhqkv5.js} +1 -1
- package/bundle/{chunk-t2vm08v6.js → chunk-rd4x4tsv.js} +1 -1
- package/bundle/chunk-rebsz3bj.js +2 -0
- package/bundle/{chunk-yp5bypsp.js → chunk-rexdr63q.js} +2 -2
- package/bundle/{chunk-1me21qdc.js → chunk-rgxy4ngt.js} +1 -1
- package/bundle/chunk-rph5xswc.js +2 -0
- package/bundle/{chunk-dcndy4sr.js → chunk-rph9zj24.js} +1 -1
- package/bundle/chunk-rqmvj7f4.js +3 -0
- package/bundle/{chunk-ryfqwsft.js → chunk-rrd0jf5m.js} +1 -1
- package/bundle/{chunk-mpygdb5a.js → chunk-s8mghr5a.js} +2 -2
- package/bundle/chunk-schtpyjs.js +2 -0
- package/bundle/{chunk-nmehsm3w.js → chunk-shwjjrj8.js} +1 -1
- package/bundle/{chunk-08f4khsw.js → chunk-snt1kefv.js} +3 -3
- package/bundle/{chunk-s8hq6trz.js → chunk-srxx88nb.js} +1 -1
- package/bundle/{chunk-gy0wm7e1.js → chunk-std2bgv7.js} +2 -2
- package/bundle/{chunk-dffhkd30.js → chunk-swcgsrbj.js} +1 -1
- package/bundle/chunk-sy3n0qhc.js +800 -0
- package/bundle/{chunk-wgk7ynt3.js → chunk-t01bhw5h.js} +3 -3
- package/bundle/chunk-t0jjes17.js +2 -0
- package/bundle/{chunk-yprmd5b7.js → chunk-t5tfppwv.js} +2 -2
- package/bundle/chunk-t8rke5fr.js +8 -0
- package/bundle/chunk-tabcpx7t.js +4 -0
- package/bundle/{chunk-gmzrvxnv.js → chunk-tdmn21z0.js} +2 -2
- package/bundle/{chunk-71zw0qhf.js → chunk-tdxbm1nd.js} +1 -1
- package/bundle/{chunk-p825vsjy.js → chunk-te5tfq79.js} +1 -1
- package/bundle/chunk-tf4xwqz7.js +2 -0
- package/bundle/{chunk-fg35hwa0.js → chunk-tgd5ctnt.js} +2 -2
- package/bundle/chunk-tqazneg6.js +2 -0
- package/bundle/{chunk-qa2j0qmy.js → chunk-txqc7543.js} +2 -2
- package/bundle/chunk-tzg4z74d.js +2 -0
- package/bundle/{chunk-a3a1trap.js → chunk-v3x5nrc4.js} +2 -2
- package/bundle/chunk-v8dd6tyn.js +2 -0
- package/bundle/chunk-v8ksjgc3.js +2 -0
- package/bundle/chunk-v8vcwx23.js +2 -0
- package/bundle/chunk-vc4e6xc4.js +10 -0
- package/bundle/chunk-vcrakhgy.js +3 -0
- package/bundle/{chunk-a1hzeejj.js → chunk-vdpd4akk.js} +2 -2
- package/bundle/{chunk-6p7yg5sr.js → chunk-vftqwdpg.js} +1 -1
- package/bundle/chunk-vg41rtdy.js +2 -0
- package/bundle/{chunk-r0k21apr.js → chunk-vgaxv70x.js} +2 -2
- package/bundle/{chunk-nkk4fyqf.js → chunk-vgnddhdj.js} +1 -1
- package/bundle/{chunk-xd3xc1vv.js → chunk-vm58fkrv.js} +1 -1
- package/bundle/{chunk-qg2vk5fw.js → chunk-vsys768k.js} +1 -1
- package/bundle/{chunk-s4qtphwx.js → chunk-w03fdrxe.js} +1 -1
- package/bundle/chunk-w1ypf53m.js +3 -0
- package/bundle/chunk-w24660y4.js +3 -0
- package/bundle/{chunk-z1ay3qd0.js → chunk-w3bmf3zz.js} +1 -1
- package/bundle/{chunk-5e4fxy99.js → chunk-w57j3pgz.js} +82 -82
- package/bundle/{chunk-vsr8mnj6.js → chunk-w5940jxm.js} +1 -1
- package/bundle/chunk-w6rf2knb.js +2 -0
- package/bundle/chunk-w9pdvcf9.js +3 -0
- package/bundle/{chunk-yk97q51d.js → chunk-wev34grp.js} +2 -2
- package/bundle/chunk-wh7r96t3.js +2 -0
- package/bundle/{chunk-1pg6pv0m.js → chunk-wm77svwm.js} +1 -1
- package/bundle/chunk-wnjqaxze.js +2 -0
- package/bundle/{chunk-qkjdr337.js → chunk-x6rr6ss1.js} +1 -1
- package/bundle/{chunk-bbzztav6.js → chunk-xdacgfba.js} +1 -1
- package/bundle/{chunk-6p94fpbn.js → chunk-xdjwapwy.js} +2 -2
- package/bundle/chunk-xfz698bh.js +2 -0
- package/bundle/{chunk-zwnhf4z1.js → chunk-xhbb8b5g.js} +1 -1
- package/bundle/chunk-xqwvx3qq.js +2 -0
- package/bundle/chunk-xxj3sgd5.js +2 -0
- package/bundle/chunk-xyjehgzm.js +3 -0
- package/bundle/{chunk-cs38g1bx.js → chunk-y0ydzdfc.js} +1 -1
- package/bundle/{chunk-wvf5q2hz.js → chunk-y1b2h15z.js} +1 -1
- package/bundle/{chunk-1gf116rg.js → chunk-yacccwf6.js} +1 -1
- package/bundle/chunk-ydc6ypjt.js +77 -0
- package/bundle/{chunk-dhqaqeq6.js → chunk-yeq7b87a.js} +1 -1
- package/bundle/chunk-yfp9y71y.js +2 -0
- package/bundle/chunk-yg9c1v8v.js +2 -0
- package/bundle/{chunk-e6xnynaz.js → chunk-yha554nm.js} +2 -2
- package/bundle/{chunk-rv1stdvb.js → chunk-yj6rbe9p.js} +2 -2
- package/bundle/chunk-yjjh339w.js +2 -0
- package/bundle/{chunk-sjw56r2n.js → chunk-yjp0btmq.js} +3 -3
- package/bundle/{chunk-c5pb87yf.js → chunk-ymtcm4xd.js} +1 -1
- package/bundle/chunk-yt6vd7a5.js +2 -0
- package/bundle/{chunk-ssk8tkwd.js → chunk-yw9pfqxt.js} +1 -1
- package/bundle/{chunk-g6cyhxwg.js → chunk-yykjvt7f.js} +2 -2
- package/bundle/{chunk-sfes6pp1.js → chunk-yzh4rmrt.js} +1 -1
- package/bundle/chunk-yzq3c3dq.js +2 -0
- package/bundle/{chunk-prh3c44x.js → chunk-yzwgvjzd.js} +1 -1
- package/bundle/chunk-z1j25911.js +2 -0
- package/bundle/{chunk-rkwrjphh.js → chunk-z1rshv6g.js} +1 -1
- package/bundle/chunk-z29ahthm.js +2 -0
- package/bundle/{chunk-jgjnz82k.js → chunk-zaan8jk6.js} +1 -1
- package/bundle/{chunk-6gb65bv1.js → chunk-zbqzm65q.js} +1 -1
- package/bundle/{chunk-bk4phk66.js → chunk-zesbm9k1.js} +1 -1
- package/bundle/{chunk-c6vfwjg4.js → chunk-zfcfyagt.js} +1 -1
- package/bundle/{chunk-ywkvq7zb.js → chunk-zfnbk5gy.js} +1 -1
- package/bundle/chunk-zgre4gc2.js +2 -0
- package/bundle/{chunk-z7430qxg.js → chunk-zrmx397j.js} +1 -1
- package/bundle/chunk-zthkjx33.js +2 -0
- package/bundle/chunk-zxddasg8.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-0442cmw2.js +0 -2
- package/bundle/chunk-085pvqr4.js +0 -2
- package/bundle/chunk-0x5jn813.js +0 -2
- package/bundle/chunk-11g2rpv8.js +0 -3
- package/bundle/chunk-28t9akfn.js +0 -2
- package/bundle/chunk-2h1fcqvf.js +0 -2
- package/bundle/chunk-2kens6wh.js +0 -2
- package/bundle/chunk-2scyp9ns.js +0 -2
- package/bundle/chunk-2tw58kwb.js +0 -2
- package/bundle/chunk-2vxx0tax.js +0 -2
- package/bundle/chunk-2ybt3p5z.js +0 -2
- package/bundle/chunk-2zpkw3ge.js +0 -2
- package/bundle/chunk-31g86yn6.js +0 -2
- package/bundle/chunk-397be2x0.js +0 -2
- package/bundle/chunk-3c78nkgn.js +0 -2
- package/bundle/chunk-3d91q2qd.js +0 -2
- package/bundle/chunk-43yv7tz1.js +0 -2
- package/bundle/chunk-496ajawz.js +0 -2
- package/bundle/chunk-499gp5g5.js +0 -2
- package/bundle/chunk-4hzm14xt.js +0 -3
- package/bundle/chunk-4xw14sed.js +0 -2
- package/bundle/chunk-536naqqv.js +0 -2
- package/bundle/chunk-57nvmhjq.js +0 -2
- package/bundle/chunk-5he3d7cy.js +0 -2
- package/bundle/chunk-5qr286w8.js +0 -2
- package/bundle/chunk-606vpgc4.js +0 -4
- package/bundle/chunk-6a1skxcj.js +0 -3
- package/bundle/chunk-6cj7cn5x.js +0 -2
- package/bundle/chunk-6hybp2mt.js +0 -2
- package/bundle/chunk-6y423jax.js +0 -3
- package/bundle/chunk-72ghkgcn.js +0 -2
- package/bundle/chunk-741teh8k.js +0 -2
- package/bundle/chunk-7b3wx6kn.js +0 -2
- package/bundle/chunk-891yevv2.js +0 -2
- package/bundle/chunk-8c1ypgw5.js +0 -3
- package/bundle/chunk-8ktgy41r.js +0 -2
- package/bundle/chunk-8q73cjyj.js +0 -2
- package/bundle/chunk-8rt63jbm.js +0 -2
- package/bundle/chunk-8y623qdx.js +0 -2
- package/bundle/chunk-921vn745.js +0 -2
- package/bundle/chunk-945ebhte.js +0 -2
- package/bundle/chunk-9548cc0c.js +0 -2
- package/bundle/chunk-9yrypq1r.js +0 -14
- package/bundle/chunk-a0rp7gh4.js +0 -77
- package/bundle/chunk-a48t0g95.js +0 -3
- package/bundle/chunk-a949at1c.js +0 -3
- package/bundle/chunk-akk84fnc.js +0 -2
- package/bundle/chunk-aw7j7brm.js +0 -2
- package/bundle/chunk-b6cybdj3.js +0 -2
- package/bundle/chunk-c5fa8cb1.js +0 -2
- package/bundle/chunk-ca4r31we.js +0 -2
- package/bundle/chunk-ckbwdrm3.js +0 -2
- package/bundle/chunk-cqj21rfj.js +0 -3
- package/bundle/chunk-cz3h5n1v.js +0 -3
- package/bundle/chunk-dhc6e1t7.js +0 -2
- package/bundle/chunk-dk6rbqvp.js +0 -2
- package/bundle/chunk-dk975etf.js +0 -3
- package/bundle/chunk-dwajajaq.js +0 -2
- package/bundle/chunk-dxcrggvq.js +0 -2
- package/bundle/chunk-dyt3n3fe.js +0 -2
- package/bundle/chunk-e74efvj2.js +0 -800
- package/bundle/chunk-e7ah0e61.js +0 -2
- package/bundle/chunk-e7v9trve.js +0 -11
- package/bundle/chunk-e8ws454m.js +0 -2
- package/bundle/chunk-efndtzby.js +0 -2
- package/bundle/chunk-eq2pepce.js +0 -2
- package/bundle/chunk-eva3nqqb.js +0 -14
- package/bundle/chunk-f3bnn9rf.js +0 -8
- package/bundle/chunk-f693s9vn.js +0 -2
- package/bundle/chunk-ftepqwyq.js +0 -2
- package/bundle/chunk-g18ax6yp.js +0 -2
- package/bundle/chunk-gadyp6mb.js +0 -2
- package/bundle/chunk-ge8315te.js +0 -5
- package/bundle/chunk-gk28ffhg.js +0 -2
- package/bundle/chunk-gpfc4z4v.js +0 -2
- package/bundle/chunk-gqvg02zp.js +0 -2
- package/bundle/chunk-gsyt2sv7.js +0 -2
- package/bundle/chunk-h3k1dk9m.js +0 -2
- package/bundle/chunk-h8c3dcqt.js +0 -2
- package/bundle/chunk-hfq11w4h.js +0 -2
- package/bundle/chunk-hw5qyht3.js +0 -3
- package/bundle/chunk-hwf58w1k.js +0 -2
- package/bundle/chunk-jyczz3yh.js +0 -8
- package/bundle/chunk-k8k8z6b7.js +0 -3
- package/bundle/chunk-kk3ve911.js +0 -2
- package/bundle/chunk-kv72hxkp.js +0 -3
- package/bundle/chunk-m4j7jyrd.js +0 -3
- package/bundle/chunk-mf3sm0pk.js +0 -2
- package/bundle/chunk-mkng9ykt.js +0 -2
- package/bundle/chunk-mxvypy3s.js +0 -2
- package/bundle/chunk-n5ypgxrn.js +0 -28
- package/bundle/chunk-n9xw9kqc.js +0 -2
- package/bundle/chunk-nc4wbc89.js +0 -2
- package/bundle/chunk-ngk67rt3.js +0 -3
- package/bundle/chunk-nj2bbtmx.js +0 -2
- package/bundle/chunk-nr1g57b2.js +0 -2
- package/bundle/chunk-p0ahbpxv.js +0 -2
- package/bundle/chunk-p7y8z5rd.js +0 -2
- package/bundle/chunk-pt26gerr.js +0 -2
- package/bundle/chunk-qkk1as5n.js +0 -2
- package/bundle/chunk-qsm9xw87.js +0 -2
- package/bundle/chunk-qw980y8h.js +0 -2
- package/bundle/chunk-r2w3gr8d.js +0 -2
- package/bundle/chunk-r5bqcpkz.js +0 -2
- package/bundle/chunk-r67c858b.js +0 -2
- package/bundle/chunk-r9fvfkee.js +0 -2
- package/bundle/chunk-rcn0dhbj.js +0 -2
- package/bundle/chunk-rq47pn3r.js +0 -2
- package/bundle/chunk-rvt1tdy8.js +0 -2
- package/bundle/chunk-ry7q8xn6.js +0 -2
- package/bundle/chunk-s27xvrft.js +0 -2
- package/bundle/chunk-s5nde2kd.js +0 -5
- package/bundle/chunk-scy39p6q.js +0 -2
- package/bundle/chunk-srpe3v8e.js +0 -9
- package/bundle/chunk-st5jaszz.js +0 -3
- package/bundle/chunk-t5qamf96.js +0 -2
- package/bundle/chunk-t9mz17gb.js +0 -3
- package/bundle/chunk-tns5x4w0.js +0 -3
- package/bundle/chunk-ttevj0pj.js +0 -2
- package/bundle/chunk-v7c54cyj.js +0 -2
- package/bundle/chunk-vgefaens.js +0 -2
- package/bundle/chunk-vv59b4re.js +0 -2
- package/bundle/chunk-vwqy7n3g.js +0 -2
- package/bundle/chunk-vysa9hp4.js +0 -7
- package/bundle/chunk-wn076jwj.js +0 -2
- package/bundle/chunk-x0m1qye9.js +0 -2
- package/bundle/chunk-xvntsbb1.js +0 -3
- package/bundle/chunk-y70aachh.js +0 -2
- package/bundle/chunk-yqk58hf6.js +0 -3
- package/bundle/chunk-ysgxt83y.js +0 -2
- package/bundle/chunk-ze9e6nt3.js +0 -3
- package/bundle/chunk-znzan00b.js +0 -3
- package/bundle/chunk-zrp55k47.js +0 -2
- package/bundle/chunk-zwdnh860.js +0 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{EA as a7,FA as o7,lA as RZ}from"./chunk-wfd5h6ax.js";import{$C as X7,$D as v7,$F as Z6,$G as BJ,$J as nY,AD as A6,AG as m8,AI as _0,AK as L$,AM as k0,BD as wJ,BH as y7,BL as m6,BM as I0,CD as HJ,CG as g7,CH as k7,DI as F0,DK as C5,DO as H$,EG as C7,EH as m7,EK as M$,EM as cY,FD as U6,FH as h7,GI as l5,GM as mY,GO as K1,HB as q,HC as H,HD as F6,HI as a$,HO as I5,IC as b,IH as $J,IM as k1,IO as p7,JB as P7,JC as y$,JH as jZ,JN as AZ,JO as tZ,KC as r,KF as p$,KH as f7,KO as k$,LB as S0,LC as BY,LD as S,LG as FY,LH as E5,MC as L1,MD as bY,MH as ZY,MI as V0,MO as SY,ND as e$,NF as L0,NH as J6,NI as bZ,OC as l1,OD as GZ,OG as h8,OO as $5,PD as gZ,PF as a5,QB as K6,QC as XZ,QF as x8,QG as d,QH as W5,RB as _6,RC as O6,RG as F,SD as zY,SG as _Z,SL as x1,TB as g0,TD as y,TF as y8,TG as WY,TL as F7,UC as PY,UG as e,UI as i0,UL as H8,VC as h,VD as j7,VF as z0,VI as g1,VN as I6,VO as X0,WF as YJ,WH as c7,WL as f,WN as w$,XC as a6,XD as j,XH as c8,XI as L6,XL as iY,YB as B6,YG as i,YH as w1,YI as M6,ZB as hZ,ZC as iZ,ZD as aZ,ZE as i$,ZF as EJ,ZG as g,ZO as h5,_C as o6,_D as z7,_F as H1,_G as eZ,_H as OY,aG as ZJ,aH as GY,aI as jJ,aM as E0,bG as M0,bI as d7,bP as XJ,cD as D6,cE as gY,cF as p5,cG as IJ,cH as u,cI as JJ,cP as n7,dC as V6,dE as IZ,dF as V1,dH as U,dI as K5,dJ as T6,eC as fY,eG as pY,eI as d8,eJ as q1,eP as E$,fE as _7,fG as $6,fH as $0,fI as u7,gC as k6,gE as Y0,gF as R8,gG as DZ,gH as Q1,gP as I$,hB as vY,hE as B5,hG as PJ,hO as tY,iG as _J,iH as n$,iI as l7,iO as r8,jB as O,jC as hY,jF as G5,jG as rY,jH as L,jO as LZ,kB as BZ,kG as sY,kI as i7,kP as P5,lI as g5,lK as u8,lM as IY,lP as wZ,mB as DY,mC as _Y,mD as G7,mM as o8,mP as J8,nB as I7,nC as RY,nD as K7,nF as w8,nH as b7,oB as $1,oE as T1,oF as A$,oG as n0,oH as X1,oK as l8,oP as O0,pB as v8,pF as U$,pG as P,pH as q7,pI as QJ,pK as i8,pP as dY,qB as b8,qC as x0,qD as V7,qE as Y1,qF as S7,qH as K0,rB as Y6,rD as z6,rE as R7,rG as J1,rH as f8,rP as OJ,sF as S8,sH as JZ,sI as n5,sK as p8,tM as T$,uB as _5,uD as y0,uH as x7,uK as n8,uM as w6,vF as F$,wD as b1,wF as x5,wH as D5,wI as o,wM as H6,xD as W6,xF as O1,xP as P$,yL as D0,yM as y1,yP as DJ,zD as q5,zG as N$,zK as D1,zM as E6}from"./chunk-a0rp7gh4.js";import{aQ as kY}from"./chunk-3k2b05fv.js";var mZ={};kY(mZ,{isHttpClientError:()=>P0,TransportError:()=>j0,StatusCodeError:()=>kZ,InvalidUrlError:()=>v0,HttpClientErrorSchema:()=>S1,HttpClientError:()=>x,EncodeError:()=>X6,EmptyBodyError:()=>R0,DecodeError:()=>TY});var H0="~effect/http/HttpClientError",P0=(Y)=>q(Y,H0);class x extends P("HttpClientError"){constructor(Y){if("cause"in Y.reason)super({...Y,cause:Y.reason.cause});else super(Y)}[H0]=H0;get request(){return this.reason.request}get response(){return"response"in this.reason?this.reason.response:void 0}get message(){return this.reason.message}}var UZ=(Y)=>Y.endsWith("Error")?Y.slice(0,-5):Y,FZ=(Y,Z,$)=>Z?`${Y}: ${Z} (${$})`:`${Y} error (${$})`;class j0 extends P("TransportError"){get methodAndUrl(){return`${this.request.method} ${this.request.url}`}get message(){return FZ(UZ(this._tag),this.description,this.methodAndUrl)}}class X6 extends P("EncodeError"){get methodAndUrl(){return`${this.request.method} ${this.request.url}`}get message(){return FZ(UZ(this._tag),this.description,this.methodAndUrl)}}class v0 extends P("InvalidUrlError"){get methodAndUrl(){return`${this.request.method} ${this.request.url}`}get message(){return FZ(UZ(this._tag),this.description,this.methodAndUrl)}}class kZ extends P("StatusCodeError"){get methodAndUrl(){return`${this.request.method} ${this.request.url}`}get message(){let Y=`${this.response.status} ${this.methodAndUrl}`;return FZ(UZ(this._tag),this.description,Y)}}class TY extends P("DecodeError"){get methodAndUrl(){return`${this.request.method} ${this.request.url}`}get message(){let Y=`${this.response.status} ${this.methodAndUrl}`;return FZ(UZ(this._tag),this.description,Y)}}class R0 extends P("EmptyBodyError"){get methodAndUrl(){return`${this.request.method} ${this.request.url}`}get message(){let Y=`${this.response.status} ${this.methodAndUrl}`;return FZ(UZ(this._tag),this.description,Y)}}class S1 extends tY(H0)({_tag:mY("HttpError"),kind:I0(["EncodeError","DecodeError","TransportError","InvalidUrlError","StatusCodeError","EmptyBodyError"]),cause:E0(AZ)}){static fromHttpClientError(Y){return new S1({_tag:"HttpError",kind:Y.reason._tag,cause:Y.reason})}}var pZ={};kY(pZ,{updateUrl:()=>zQ,trace:()=>XQ,toWebResult:()=>Z7,toWeb:()=>vQ,toUrl:()=>o1,setUrlParams:()=>e6,setUrlParam:()=>_Q,setUrl:()=>EZ,setMethod:()=>r6,setHeaders:()=>p0,setHeader:()=>HZ,setHash:()=>Y7,setBody:()=>$Y,schemaBodyJson:()=>NQ,removeHash:()=>DQ,put:()=>ZQ,prependUrl:()=>a1,post:()=>eJ,patch:()=>YQ,options:()=>QQ,modify:()=>p1,makeWith:()=>R,make:()=>KY,isHttpClientRequest:()=>KZ,head:()=>JQ,get:()=>tJ,fromWeb:()=>EQ,empty:()=>i1,delete:()=>$Q,bodyUrlParams:()=>LQ,bodyUint8Array:()=>WQ,bodyText:()=>AQ,bodyStream:()=>wQ,bodyJsonUnsafe:()=>FQ,bodyJson:()=>UQ,bodyFormDataRecord:()=>TQ,bodyFormData:()=>MQ,bodyFile:()=>HQ,bearerToken:()=>KQ,basicAuth:()=>GQ,appendUrlParams:()=>OQ,appendUrlParam:()=>BQ,appendUrl:()=>VQ,acceptJson:()=>s6,accept:()=>n1});var G6=Symbol.for("~effect/http/Headers");var NZ=Object.create(null);Object.defineProperties(NZ,{[G6]:{value:G6},[V6]:{value(Y){return YZ(this,y(Y,cZ))}},toJSON:{value(){return fY(this)}},[g0]:{value(Y){return fJ(this,Y)}},[S0]:{value(){return K6(this)}},toString:{value:_Y.toString},[hY]:{value:_Y[hY]}});var C0=(Y)=>Object.assign(Object.create(NZ),Y),fJ=z6(hZ());var n=Object.create(NZ),C=(Y)=>{if(Y===void 0)return n;else if(Symbol.iterator in Y){let $=Object.create(NZ);for(let[J,Q]of Y)$[J.toLowerCase()]=Q;return $}let Z=Object.create(NZ);for(let[$,J]of Object.entries(Y))if(Array.isArray(J))Z[$.toLowerCase()]=J.join(", ");else if(J!==void 0)Z[$.toLowerCase()]=J;return Z},wY=(Y)=>Object.setPrototypeOf(Y,NZ);var HY=O(3,(Y,Z,$)=>{let J=C0(Y);return J[Z.toLowerCase()]=$,J}),b0=O(2,(Y,Z)=>C0({...Y,...C(Z)})),fZ=O(2,(Y,Z)=>{let $=C0(Y);return Object.assign($,Z),$}),q0=O(2,(Y,Z)=>{let $=C0(Y);return delete $[Z.toLowerCase()],$});var YZ=O(2,(Y,Z)=>{let $={...Y},J=(Q)=>{if(typeof Q==="string"){let X=Q.toLowerCase();if(X in Y)$[X]=g1(Y[X])}else for(let X in Y)if(Q.test(X))$[X]=g1(Y[X])};if(Array.isArray(Z))for(let Q=0;Q<Z.length;Q++)J(Z[Q]);else J(Z);return $}),cZ=j("effect/Headers/CurrentRedactedNames",{defaultValue:()=>["authorization","cookie","set-cookie","x-api-key"]});var C1="~effect/http/UrlParams",cJ=(Y)=>q(Y,C1),dJ={...x0,[C1]:C1,[Symbol.iterator](){return this.params[Symbol.iterator]()},toJSON(){return{_id:"UrlParams",params:Object.fromEntries(this.params)}},[g0](Y){return j6(this,Y)},[S0](){return _6(this.params.flat())}},ZZ=(Y)=>{let Z=Object.create(dJ);return Z.params=Y,Z},a=(Y)=>{let Z=P6(Y),$=[];for(let J=0;J<Z.length;J++)if(Array.isArray(Z[J][0])){let[Q,X]=Z[J];$.push([`${Q[0]}[${Q.slice(1).join("][")}]`,X])}else $.push(Z[J]);return ZZ($)},P6=(Y)=>{let Z=typeof Y[Symbol.iterator]==="function"?y0(Y):Object.entries(Y),$=[];for(let[J,Q]of Z)if(Array.isArray(Q)){for(let X=0;X<Q.length;X++)if(Q[X]!==void 0)$.push([J,String(Q[X])])}else if(typeof Q==="object"){let X=P6(Q);for(let[G,K]of X)$.push([[J,...typeof G==="string"?[G]:G],K])}else if(Q!==void 0)$.push([J,String(Q)]);return $},j6=B6((Y,Z)=>uJ(Y.params,Z.params)),uJ=F6(D6([hZ(),hZ()])),v6=x1(cJ,{typeConstructor:{_tag:"effect/http/UrlParams"},generation:{runtime:"UrlParams.UrlParamsSchema",Type:"UrlParams.UrlParams",Encoded:'typeof UrlParams.UrlParamsSchema["Encoded"]',importDeclaration:'import * as UrlParams from "effect/unstable/http/UrlParams"'},expected:"UrlParams",toEquivalence:()=>j6,toCodec:()=>k1()(y1(H6([IY,IY])),q1({decode:ZZ,encode:(Y)=>Y.params}))}),m0=ZZ([]);var lJ=O(2,(Y,Z)=>A6(Y.params,([$])=>$===Z).pipe(O6(([,$])=>$)));var R6=O(3,(Y,Z,$)=>ZZ(b1(U6(Y.params,([J])=>J!==Z),[Z,String($)]))),iJ=O(2,(Y,Z)=>ZZ(Z(Y.params))),S6=O(2,(Y,Z)=>{let $=a(Z),J=$.params,Q=new Set;for(let X=0;X<J.length;X++)Q.add(J[X][0]);for(let X=0;X<Y.params.length;X++){if(Q.has(Y.params[X][0]))continue;J.push(Y.params[X])}return $}),g6=O(3,(Y,Z,$)=>ZZ(b1(Y.params,[Z,String($)]))),C6=O(2,(Y,Z)=>iJ(Y,W6(a(Z).params)));class h0 extends P("UrlParamsError"){}var uZ=(Y,Z,$)=>{try{let J=new URL(Y,pJ());for(let Q=0;Q<Z.params.length;Q++){let[X,G]=Z.params[Q];if(G!==void 0)J.searchParams.append(X,G)}if($!==void 0)J.hash=$;return PY(J)}catch(J){return h(new h0({cause:J}))}},f0=(Y)=>new URLSearchParams(Y.params).toString(),pJ=()=>{if("location"in globalThis&&globalThis.location!==void 0&&globalThis.location.origin!==void 0&&globalThis.location.pathname!==void 0)return location.origin+location.pathname;return},nJ=(Y)=>{let Z={};for(let[$,J]of Y.params){let Q=Z[$];if(Q===void 0)Z[$]=J;else if(typeof Q==="string")Z[$]=[Q,J];else Q.push(J)}return Z},aJ=nJ,b6=(Y)=>v6.pipe(cY(I6,T6({decode:(Z)=>BY(lJ(Z,Y),{onNone:()=>g(new L6([Y],new M6(void 0))),onSome:F}),encode:(Z)=>F(ZZ([[Y,Z]]))}))),q6=v6.pipe(cY(w6(IY,k0([IY,E6(IY)])),q1({decode:aJ,encode:a})));var m1="~effect/http/HttpBody";var x6="~effect/http/HttpBody/HttpBodyError";class f1 extends P("HttpBodyError"){[x6]=x6}class MZ{[m1];constructor(){this[m1]=m1}[hY](){return this.toJSON()}toString(){return k6(this,{ignoreToString:!0})}}class h6 extends MZ{_tag="Empty";toJSON(){return{_id:"effect/HttpBody",_tag:"Empty"}}}var QZ=new h6;class f6 extends MZ{_tag="Raw";body;contentType;contentLength;constructor(Y,Z,$){super();this.body=Y,this.contentType=Z,this.contentLength=$}toJSON(){return{_id:"effect/HttpBody",_tag:"Raw",body:this.body,contentType:this.contentType,contentLength:this.contentLength}}}var c1=(Y,Z)=>new f6(Y,Z?.contentType,Z?.contentLength);class c6 extends MZ{_tag="Uint8Array";body;contentType;contentLength;constructor(Y,Z,$){super();this.body=Y,this.contentType=Z,this.contentLength=$}toJSON(){return{_id:"effect/HttpBody",_tag:"Uint8Array",body:this.contentType.startsWith("text/")||this.contentType.endsWith("json")?new TextDecoder().decode(this.body):`Uint8Array(${this.body.length})`,contentType:this.contentType,contentLength:this.contentLength}}}var lZ=(Y,Z)=>new c6(Y,Z??"application/octet-stream",Y.length),oJ=new TextEncoder,uY=(Y,Z)=>lZ(oJ.encode(Y),Z??"text/plain"),c0=(Y,Z)=>uY(JSON.stringify(Y),Z??"application/json"),d0=(Y,Z)=>GY({try:()=>uY(JSON.stringify(Y),Z??"application/json"),catch:($)=>new f1({reason:{_tag:"JsonError"},cause:$})}),d1=(Y,Z)=>{let $=m6(LZ(Y));return(J,Q)=>$(J,Z).pipe(JZ((X)=>new f1({reason:{_tag:"SchemaError",issue:X},cause:X})),U((X)=>d0(X,Q)))},d6=(Y,Z)=>uY(f0(Y),Z??"application/x-www-form-urlencoded");class u6 extends MZ{_tag="FormData";contentType=void 0;contentLength=void 0;formData;constructor(Y){super();this.formData=Y}toJSON(){return{_id:"effect/HttpBody",_tag:"FormData",formData:this.formData}}}var u0=(Y)=>new u6(Y),y6=(Y,Z,$)=>{if($==null)return;if(typeof $==="object"){Y.append(Z,$);return}Y.append(Z,String($))},l6=(Y)=>{let Z=new globalThis.FormData;for(let[$,J]of Object.entries(Y))if(Array.isArray(J))for(let Q of J)y6(Z,$,Q);else y6(Z,$,J);return u0(Z)};class i6 extends MZ{_tag="Stream";stream;contentType;contentLength;constructor(Y,Z,$){super();this.stream=Y,this.contentType=Z,this.contentLength=$}toJSON(){return{_id:"effect/HttpBody",_tag:"Stream",contentType:this.contentType,contentLength:this.contentLength}}}var jY=(Y,Z,$)=>new i6(Y,Z??"application/octet-stream",$),p6=(Y,Z)=>U(dY.asEffect(),($)=>L($.stat(Y),(J)=>jY($.stream(Y,Z),Z?.contentType,Number(J.size))));var TZ=(Y)=>Y!=="GET"&&Y!=="HEAD"&&Y!=="OPTIONS"&&Y!=="TRACE";var n6=[["GET","get"],["POST","post"],["PUT","put"],["DELETE","del"],["PATCH","patch"],["HEAD","head"],["OPTIONS","options"],["TRACE","trace"]];var u1="~effect/http/HttpClientRequest",KZ=(Y)=>q(Y,u1),sJ={[u1]:u1,..._Y,toJSON(){return{_id:"HttpClientRequest",method:this.method,url:this.url,urlParams:this.urlParams,hash:this.hash,headers:fY(this.headers),body:this.body.toJSON()}},pipe(){return vY(this,arguments)}};function R(Y,Z,$,J,Q,X){let G=Object.create(sJ);return G.method=Y,G.url=Z,G.urlParams=$,G.hash=J,G.headers=Q,G.body=X,G}var i1=R("GET","",m0,H(),n,QZ),KY=(Y)=>(Z,$)=>p1(i1,{method:Y,url:Z,...$??void 0}),tJ=KY("GET"),eJ=KY("POST"),YQ=KY("PATCH"),ZQ=KY("PUT"),$Q=KY("DELETE");var JQ=KY("HEAD"),QQ=KY("OPTIONS"),XQ=KY("TRACE"),p1=O(2,(Y,Z)=>{let $=Y;if(Z.method)$=r6($,Z.method);if(Z.url)$=EZ($,Z.url);if(Z.headers)$=p0($,Z.headers);if(Z.urlParams)$=e6($,Z.urlParams);if(Z.hash)$=Y7($,Z.hash);if(Z.body)$=$Y($,Z.body);if(Z.accept)$=n1($,Z.accept);if(Z.acceptJson)$=s6($);return $}),r6=O(2,(Y,Z)=>R(Z,Y.url,Y.urlParams,Y.hash,Y.headers,Y.body)),HZ=O(3,(Y,Z,$)=>R(Y.method,Y.url,Y.urlParams,Y.hash,HY(Y.headers,Z,$),Y.body)),p0=O(2,(Y,Z)=>R(Y.method,Y.url,Y.urlParams,Y.hash,b0(Y.headers,Z),Y.body)),GQ=O(3,(Y,Z,$)=>HZ(Y,"Authorization",`Basic ${btoa(`${i0(Z)}:${i0($)}`)}`)),KQ=O(2,(Y,Z)=>HZ(Y,"Authorization",`Bearer ${i0(Z)}`)),n1=O(2,(Y,Z)=>HZ(Y,"Accept",Z)),s6=n1("application/json"),EZ=O(2,(Y,Z)=>{if(typeof Z==="string")return R(Y.method,Z,Y.urlParams,Y.hash,Y.headers,Y.body);let $=new URL(Z.toString()),J=a($.searchParams),Q=l1($.hash===""?void 0:$.hash.slice(1));return $.search="",$.hash="",R(Y.method,$.toString(),J,Q,Y.headers,Y.body)}),a1=O(2,(Y,Z)=>{if(Z==="")return Y;return R(Y.method,t6(Z,Y.url),Y.urlParams,Y.hash,Y.headers,Y.body)}),VQ=O(2,(Y,Z)=>{if(Z==="")return Y;return R(Y.method,t6(Y.url,Z),Y.urlParams,Y.hash,Y.headers,Y.body)}),t6=(Y,Z)=>{let $=Y.endsWith("/"),J=Z.startsWith("/");return $&&J?Y+Z.slice(1):!$&&!J?Y+"/"+Z:Y+Z},zQ=O(2,(Y,Z)=>R(Y.method,Z(Y.url),Y.urlParams,Y.hash,Y.headers,Y.body)),_Q=O(3,(Y,Z,$)=>R(Y.method,Y.url,R6(Y.urlParams,Z,$),Y.hash,Y.headers,Y.body)),e6=O(2,(Y,Z)=>R(Y.method,Y.url,S6(Y.urlParams,Z),Y.hash,Y.headers,Y.body)),BQ=O(3,(Y,Z,$)=>R(Y.method,Y.url,g6(Y.urlParams,Z,$),Y.hash,Y.headers,Y.body)),OQ=O(2,(Y,Z)=>R(Y.method,Y.url,C6(Y.urlParams,Z),Y.hash,Y.headers,Y.body)),Y7=O(2,(Y,Z)=>R(Y.method,Y.url,Y.urlParams,b(Z),Y.headers,Y.body)),DQ=(Y)=>R(Y.method,Y.url,Y.urlParams,H(),Y.headers,Y.body),$Y=O(2,(Y,Z)=>{let $=Y.headers;if(Z._tag==="Empty"||Z._tag==="FormData")$=q0(q0($,"Content-Type"),"Content-length");else{if(Z.contentType)$=HY($,"content-type",Z.contentType);if(Z.contentLength!==void 0)$=HY($,"content-length",Z.contentLength.toString())}return R(Y.method,Y.url,Y.urlParams,Y.hash,$,Z)}),WQ=O((Y)=>KZ(Y[0]),(Y,Z,$)=>$Y(Y,lZ(Z,$))),AQ=O((Y)=>KZ(Y[0]),(Y,Z,$)=>$Y(Y,uY(Z,$))),UQ=O(2,(Y,Z)=>L(d0(Z),($)=>$Y(Y,$))),FQ=O(2,(Y,Z)=>$Y(Y,c0(Z))),NQ=(Y,Z)=>{let $=d1(Y,Z);return O(2,(J,Q)=>L($(Q),(X)=>$Y(J,X)))},LQ=O(2,(Y,Z)=>$Y(Y,d6(a(Z)))),MQ=O(2,(Y,Z)=>$Y(Y,u0(Z))),TQ=O(2,(Y,Z)=>$Y(Y,l6(Z))),wQ=O((Y)=>KZ(Y[0]),(Y,Z,$)=>$Y(Y,jY(Z,$?.contentType,$?.contentLength))),HQ=O((Y)=>KZ(Y[0]),(Y,Z,$)=>L(p6(Z,$),(J)=>$Y(Y,J)));function o1(Y){let Z=uZ(Y.url,Y.urlParams,XZ(Y.hash));if(o6(Z))return b(Z.success);return H()}var EQ=(Y)=>{let Z=Y.method.toUpperCase();return p1(i1,{method:Z,url:new URL(Y.url),headers:Y.headers,body:IQ(Y,Z)})},IQ=(Y,Z)=>{if(!TZ(Z)||Y.body===null)return QZ;return c1(Y.body,{contentType:Y.headers.get("content-type")??void 0,contentLength:PQ(Y.headers.get("content-length"))})},PQ=(Y)=>{if(Y===null)return;let Z=Number.parseInt(Y,10);return Number.isNaN(Z)?void 0:Z},Z7=(Y,Z)=>{let $=uZ(Y.url,Y.urlParams,XZ(Y.hash));if(iZ($))return h($.failure);let J={method:Y.method,headers:Y.headers};if(Z?.signal)J.signal=Z.signal;if(TZ(Y.method))switch(Y.body._tag){case"Empty":break;case"Raw":{if(J.body=Y.body.body,jQ(Y.body.body))J.duplex="half";break}case"Uint8Array":{J.body=Y.body.body;break}case"FormData":{J.body=Y.body.formData;break}case"Stream":{J.body=wZ(Y.body.stream,Z?.context??GZ()),J.duplex="half";break}}return a6({try:()=>new Request($.success,J),catch:(Q)=>new h0({cause:Q})})},jQ=(Y)=>typeof ReadableStream<"u"&&Y instanceof ReadableStream,vQ=(Y,Z)=>ZY(($)=>Z7(Y,{context:$,signal:Z?.signal}).asEffect());var e0={};kY(e0,{stream:()=>kQ,schemaNoBody:()=>yQ,schemaJson:()=>xQ,schemaHeaders:()=>N7,schemaBodyUrlParams:()=>oZ,schemaBodyJson:()=>s0,matchStatus:()=>mQ,fromWeb:()=>J5,filterStatusOk:()=>X5,filterStatus:()=>Q5,TypeId:()=>zZ});var r1="~effect/http/Cookies",SQ=(Y)=>q(Y,r1);var $7="~effect/http/Cookies/Cookie";var J7="~effect/http/Cookies/CookieError";class B7 extends n0{}class VZ extends P("CookieError"){static fromReason(Y,Z){return new VZ({reason:new B7({_tag:Y,cause:Z})})}[J7]=J7;get message(){return this.reason._tag}}var gQ={[r1]:r1,..._Y,toJSON(){return{_id:"effect/Cookies",cookies:K7(this.cookies,(Y)=>Y.toJSON())}},pipe(){return vY(this,arguments)}},t1=(Y)=>{let Z=Object.create(gQ);return Z.cookies=Y,Z},O7=(Y)=>{let Z={};for(let $ of Y)Z[$.name]=$;return t1(Z)},e1=(Y)=>{let Z=typeof Y==="string"?[Y]:Y,$=[];for(let J of Z){let Q=CQ(J.trim());if(Q)$.push(Q)}return O7($)};function CQ(Y){let Z=Y.split(";").map((K)=>K.trim()).filter((K)=>K!=="");if(Z.length===0)return;let $=Z[0].indexOf("=");if($===-1)return;let J=Z[0].slice(0,$);if(!nZ.test(J))return;let Q=Z[0].slice($+1),X=U7(Q);if(Z.length===1)return Object.assign(Object.create(s1),{name:J,value:X,valueEncoded:Q});let G={};for(let K=1;K<Z.length;K++){let z=Z[K],_=z.indexOf("="),B=_===-1?z:z.slice(0,_).trim(),V=_===-1?void 0:z.slice(_+1).trim();switch(B.toLowerCase()){case"domain":{if(V===void 0)break;let D=V.trim().replace(/^\./,"");if(D)G.domain=D;break}case"expires":{if(V===void 0)break;let D=new Date(V);if(!isNaN(D.getTime()))G.expires=D;break}case"max-age":{if(V===void 0)break;let D=parseInt(V,10);if(!isNaN(D))G.maxAge=IZ(D);break}case"path":{if(V===void 0)break;if(V[0]==="/")G.path=V;break}case"priority":{if(V===void 0)break;switch(V.toLowerCase()){case"low":G.priority="low";break;case"medium":G.priority="medium";break;case"high":G.priority="high";break}break}case"httponly":{G.httpOnly=!0;break}case"secure":{G.secure=!0;break}case"partitioned":{G.partitioned=!0;break}case"samesite":{if(V===void 0)break;switch(V.toLowerCase()){case"lax":G.sameSite="lax";break;case"strict":G.sameSite="strict";break;case"none":G.sameSite="none";break}break}}}return Object.assign(Object.create(s1),{name:J,value:X,valueEncoded:Q,options:Object.keys(G).length>0?G:void 0})}var a0=O7([]),o0=(Y)=>G7(Y.cookies),nZ=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,s1={[$7]:$7,..._Y,toJSON(){return{_id:"effect/Cookies/Cookie",name:this.name,value:this.value,options:this.options}}};function bQ(Y,Z,$){if(!nZ.test(Y))return h(VZ.fromReason("InvalidCookieName"));let J=encodeURIComponent(Z);if(J&&!nZ.test(J))return h(VZ.fromReason("InvalidCookieValue"));if($!==void 0){if($.domain!==void 0&&!nZ.test($.domain))return h(VZ.fromReason("InvalidCookieDomain"));if($.path!==void 0&&!nZ.test($.path))return h(VZ.fromReason("InvalidCookiePath"));if($.maxAge!==void 0&&!z7(aZ($.maxAge)))return h(VZ.fromReason("CookieInfinityMaxAge"))}return PY(Object.assign(Object.create(s1),{name:Y,value:Z,valueEncoded:J,options:$}))}var Y5=O(2,(Y,Z)=>t1({...Y.cookies,...Z.cookies}));var D7=O((Y)=>SQ(Y[0]),(Y,Z,$,J)=>X7(bQ(Z,$,J),(Q)=>t1(V7(Y.cookies,Z,Q))));function qQ(Y){let Z=Y.name+"="+Y.valueEncoded;if(Y.options===void 0)return Z;let $=Y.options;if($.maxAge!==void 0){let J=_7(aZ($.maxAge));Z+="; Max-Age="+Math.trunc(J)}if($.domain!==void 0)Z+="; Domain="+$.domain;if($.path!==void 0)Z+="; Path="+$.path;if($.priority!==void 0)switch($.priority){case"low":Z+="; Priority=Low";break;case"medium":Z+="; Priority=Medium";break;case"high":Z+="; Priority=High";break}if($.expires!==void 0)Z+="; Expires="+$.expires.toUTCString();if($.httpOnly)Z+="; HttpOnly";if($.secure)Z+="; Secure";if($.partitioned)Z+="; Partitioned";if($.sameSite!==void 0)switch($.sameSite){case"lax":Z+="; SameSite=Lax";break;case"strict":Z+="; SameSite=Strict";break;case"none":Z+="; SameSite=None";break}return Z}var W7=(Y)=>Object.values(Y.cookies).map((Z)=>`${Z.name}=${Z.valueEncoded}`).join("; ");var A7=(Y)=>Object.values(Y.cookies).map(qQ);function Z5(Y){let Z={},$=Y.length,J=0,Q=0;while(!0){if(Q===$)break;if(Q=Y.indexOf(";",J),Q===-1)Q=$;let X=Y.indexOf("=",J);if(X===-1)break;if(X>Q){J=Q+1;continue}let G=Y.substring(J,X++).trim();if(Z[G]===void 0){let K=Y.charCodeAt(X)===34?Y.substring(X+1,Q-1).trim():Y.substring(X,Q).trim();Z[G]=K.indexOf("%")!==-1?U7(K):K}J=Q+1}return Z}var U7=(Y)=>{try{return decodeURIComponent(Y)}catch(Z){return Y}};var c="~effect/http/HttpIncomingMessage";var s0=(Y,Z)=>{let $=iY(LZ(Y).annotate({options:Z}));return(J)=>U(J.json,$)},oZ=(Y,Z)=>{let $=q6.pipe(cY(Y),F7({options:Z}),iY);return(J)=>U(J.urlParamsBody,$)},N7=(Y,Z)=>{let $=f(Y);return(J)=>$(J.headers,Z)},rZ=j("effect/http/HttpIncomingMessage/MaxBodySize",{defaultValue:()=>{return}}),sZ=(Y,Z)=>{let $=Y.headers["content-type"]??"",J;if($.includes("application/json"))try{J=o(Y.json)}catch(X){}else if($.includes("text/")||$.includes("urlencoded"))try{J=o(Y.text)}catch(X){}let Q={...Z,headers:fY(Y.headers),remoteAddress:Y.remoteAddress};if(J!==void 0)Q.body=J;return Q};var zZ="~effect/http/HttpClientResponse",J5=(Y,Z)=>new L7(Y,Z),xQ=(Y,Z)=>{let $=iY(LZ(Y).annotate({options:Z}));return(J)=>U(J.json,(Q)=>$({status:J.status,headers:J.headers,body:Q}))},yQ=(Y,Z)=>{let $=iY(Y.annotate({options:Z}));return(J)=>$({status:J.status,headers:J.headers})},kQ=(Y)=>$5(L(Y,(Z)=>Z.stream)),mQ=O(2,(Y,Z)=>{let $=Y.status;if(Z[$])return Z[$](Y);else if($>=200&&$<300&&Z["2xx"])return Z["2xx"](Y);else if($>=300&&$<400&&Z["3xx"])return Z["3xx"](Y);else if($>=400&&$<500&&Z["4xx"])return Z["4xx"](Y);else if($>=500&&$<600&&Z["5xx"])return Z["5xx"](Y);return Z.orElse(Y)}),Q5=O(2,(Y,Z)=>_Z(()=>Z(Y.status)?F(Y):g(new x({reason:new kZ({response:Y,request:Y.request,description:"invalid status code"})})))),X5=(Y)=>Y.status>=200&&Y.status<300?F(Y):g(new x({reason:new kZ({response:Y,request:Y.request,description:"non 2xx status code"})}));class L7 extends RY{[c];[zZ];request;source;constructor(Y,Z){super();this.request=Y,this.source=Z,this[c]=c,this[zZ]=zZ}toJSON(){return sZ(this,{_id:"HttpClientResponse",request:this.request.toJSON(),status:this.status})}get status(){return this.source.status}get headers(){return C(this.source.headers)}cachedCookies;get cookies(){if(this.cachedCookies)return this.cachedCookies;return this.cachedCookies=e1(this.source.headers.getSetCookie())}get remoteAddress(){return H()}get stream(){return this.source.body?SY({evaluate:()=>this.source.body,onError:(Y)=>new x({reason:new TY({request:this.request,response:this,cause:Y})})}):tZ(new x({reason:new R0({request:this.request,response:this,description:"can not create stream from empty body"})}))}get json(){return U(this.text,(Y)=>GY({try:()=>Y===""?null:JSON.parse(Y),catch:(Z)=>new x({reason:new TY({request:this.request,response:this,cause:Z})})}))}textBody;get text(){return this.textBody??=d({try:()=>this.source.text(),catch:(Y)=>new x({reason:new TY({request:this.request,response:this,cause:Y})})}).pipe(OY,o)}get urlParamsBody(){return U(this.text,(Y)=>GY({try:()=>a(new URLSearchParams(Y)),catch:(Z)=>new x({reason:new TY({request:this.request,response:this,cause:Z})})}))}formDataBody;get formData(){return this.formDataBody??=d({try:()=>this.source.formData(),catch:(Y)=>new x({reason:new TY({request:this.request,response:this,cause:Y})})}).pipe(OY,o)}arrayBufferBody;get arrayBuffer(){return this.arrayBufferBody??=d({try:()=>this.source.arrayBuffer(),catch:(Y)=>new x({reason:new TY({request:this.request,response:this,cause:Y})})}).pipe(OY,o)}pipe(){return vY(this,arguments)}}var G1={};kY(G1,{withScope:()=>HX,withRateLimiter:()=>OX,withCookiesRef:()=>wX,transformResponse:()=>s,transform:()=>A5,tapRequest:()=>TX,tapError:()=>MX,tap:()=>LX,retryTransient:()=>BX,retry:()=>_X,put:()=>rQ,post:()=>aQ,patch:()=>oQ,options:()=>tQ,mapRequestInputEffect:()=>zX,mapRequestInput:()=>VX,mapRequestEffect:()=>KX,mapRequest:()=>F5,makeWith:()=>VY,make:()=>U5,layerMergedContext:()=>N5,isHttpClient:()=>r7,head:()=>nQ,get:()=>pQ,followRedirects:()=>EX,filterStatusOk:()=>XX,filterStatus:()=>QX,filterOrFail:()=>JX,filterOrElse:()=>$X,execute:()=>iQ,del:()=>sQ,catchTags:()=>ZX,catchTag:()=>YX,catch:()=>eQ,TracerPropagationEnabled:()=>e7,TracerDisabledWhen:()=>t7,SpanNameGenerator:()=>Y8,HttpClient:()=>vZ});var T7=(Y)=>wY({b3:`${Y.traceId}-${Y.spanId}-${Y.sampled?"1":"0"}${BY(Y.parent,{onNone:()=>"",onSome:(Z)=>`-${Z.spanId}`})}`,traceparent:`00-${Y.traceId}-${Y.spanId}-${Y.sampled?"01":"00"}`}),w7=(Y)=>{let Z=uQ(Y);if(r(Z))return Z;if(Z=hQ(Y),r(Z))return Z;return fQ(Y)},hQ=(Y)=>{if(!("b3"in Y))return H();let Z=Y.b3.split("-");if(Z.length<2)return H();return b(Y1({traceId:Z[0],spanId:Z[1],sampled:Z[2]?Z[2]==="1":!0}))},fQ=(Y)=>{if(!Y["x-b3-traceid"]||!Y["x-b3-spanid"])return H();return b(Y1({traceId:Y["x-b3-traceid"],spanId:Y["x-b3-spanid"],sampled:Y["x-b3-sampled"]?Y["x-b3-sampled"]==="1":!0}))},cQ=/^[0-9a-f]{32}$/i,dQ=/^[0-9a-f]{16}$/i,uQ=(Y)=>{if(!Y.traceparent)return H();let Z=Y.traceparent.split("-");if(Z.length!==4)return H();let[$,J,Q,X]=Z;switch($){case"00":{if(cQ.test(J)===!1||dQ.test(Q)===!1)return H();return b(Y1({traceId:J,spanId:Q,sampled:(parseInt(X,16)&1)===1}))}default:return H()}};var V5="~effect/http/HttpClient",r7=(Y)=>q(Y,V5),vZ=S("effect/HttpClient"),aY=(Y)=>(...Z)=>U(vZ.asEffect(),($)=>$[Y](...Z)),iQ=aY("execute"),pQ=aY("get"),nQ=aY("head"),aQ=aY("post"),oQ=aY("patch"),rQ=aY("put"),sQ=aY("del"),tQ=aY("options"),A5=O(2,(Y,Z)=>VY(U(($)=>Z(Y.postprocess(F($)),$)),Y.preprocess)),s=O(2,(Y,Z)=>VY(($)=>Z(Y.postprocess($)),Y.preprocess)),eQ=O(2,(Y,Z)=>s(Y,b7(Z)));var YX=O(3,(Y,Z,$)=>s(Y,X1(Z,$))),ZX=O(2,(Y,Z)=>s(Y,q7(Z))),$X=O(3,(Y,Z,$)=>s(Y,m7(Z,$))),JX=O(3,(Y,Z,$)=>s(Y,h7(Z,$))),QX=O(2,(Y,Z)=>s(Y,U(Q5(Z)))),XX=s(U(X5)),VY=(Y,Z)=>{let $=Object.create(GX);return $.preprocess=Z,$.postprocess=Y,$.execute=function(J){return Y(Z(J))},$},GX={[V5]:V5,pipe(){return vY(this,arguments)},..._Y,toJSON(){return{_id:"effect/HttpClient"}},...Object.fromEntries(n6.map(([Y,Z])=>[Z,function($,J){return this.execute(KY(Y)($,J))}]))},U5=(Y)=>VY((Z)=>U(Z,($)=>u((J)=>{let Q=Z8.get($),X=Q??new AbortController,G=uZ($.url,$.urlParams,XZ($.hash));if(iZ(G))return g(new x({reason:new v0({request:$,cause:G.failure})}));let K=G.success;if(J.getRef(R7)||J.getRef(t7)($)){let _=Y($,K,X.signal,J);if(Q)return _;return K5((B)=>jZ(B(_),{onSuccess(V){return Z1.register(V,X),F(new z5(V,X))},onFailure(V){if(G5(V))X.abort();return eZ(V)}}))}return l7(J.getRef(Y8)($),{kind:"client"},(_)=>{if(_.attribute("http.request.method",$.method),_.attribute("server.address",K.origin),K.port!=="")_.attribute("server.port",+K.port);_.attribute("url.full",K.toString()),_.attribute("url.path",K.pathname),_.attribute("url.scheme",K.protocol.slice(0,-1));let B=K.search.slice(1);if(B!=="")_.attribute("url.query",B);let V=J.getRef(cZ),D=YZ($.headers,V);for(let A in D)_.attribute(`http.request.header.${A}`,String(D[A]));return $=J.getRef(e7)?p0($,T7(_)):$,K5((A)=>A(Y($,K,X.signal,J)).pipe(i7(_,{captureStackTrace:!1}),jZ({onSuccess:(W)=>{_.attribute("http.response.status_code",W.status);let N=YZ(W.headers,V);for(let T in N)_.attribute(`http.response.header.${T}`,String(N[T]));if(Q)return F(W);return Z1.register(W,X),F(new z5(W,X))},onFailure(W){if(!Q&&G5(W))X.abort();return eZ(W)}})))})})),F),F5=O(2,(Y,Z)=>VY(Y.postprocess,($)=>L(Y.preprocess($),Z))),KX=O(2,(Y,Z)=>VY(Y.postprocess,($)=>U(Y.preprocess($),Z))),VX=O(2,(Y,Z)=>VY(Y.postprocess,($)=>Y.preprocess(Z($)))),zX=O(2,(Y,Z)=>VY(Y.postprocess,($)=>U(Z($),Y.preprocess))),_X=O(2,(Y,Z)=>s(Y,D5(Z))),BX=O(2,(Y,Z)=>{let $=g7(Z),J=$?"errors-and-responses":Z.retryOn??"errors-and-responses",Q=$?Z:Z.schedule,X=Q&&C7(Q),G=$?void 0:Z.times;return s(Y,_5(J==="errors-only"?BZ:u7({schedule:X,times:G,while:$8}),J==="response-only"?BZ:D5({while:$||Z.while===void 0?E7:P7(E7,Z.while),schedule:Q,times:G})))}),OX=O(2,(Y,Z)=>{let $={initial:!0,limit:Z.limit,window:Y0(aZ(Z.window),gY(1))},J=new Map,Q=Z.key,X=typeof Q==="function"?Q:DY(Q),G=Z.tokens,K=typeof G==="function"?G:DY(G??1),z=(B)=>{let V=J.get(B);if(V!==void 0)return V;return J.set(B,$),$},_=Z.disableResponseInspection?void 0:(B,V,D,A)=>{let W=z(V),N=DX(W,B,D,A);if(N.limit!==W.limit||!B5(N.window,W.window))J.set(V,N)};return A5(Y,function B(V,D){let W=nY().getRef(J1),N=X(D),T=Math.max(K(D),1),E=z(N);function YY(I){if(Z.disableResponseInspection)return B(V,D);let p=s7(W,PZ(I.headers,"retry-after"));return p?U(k7(p),()=>B(V,D)):B(V,D)}return U(Z.limiter.consume({algorithm:Z.algorithm,onExceeded:"delay",key:N,limit:E.limit,window:E.window,tokens:T}),({delay:I})=>{let p=f7(V,{onSuccess(w){if(_?.(W,N,w.headers,T),w.status!==429)return F(w);return YY(w)},onFailure(w){if(PX(w))return _?.(W,N,w.reason.response.headers,T),YY(w.reason.response);return g(w)}});return v7(I)?p:y7(p,I)})})}),DX=(Y,Z,$,J)=>{let Q=WX(Y,$,J)??Y.limit,X=UX(Z,$)??Y.window;if(Q===Y.limit&&B5(X,Y.window))return Y;return{limit:Q,window:X,initial:!1}},WX=(Y,Z,$)=>{let J=PZ(Z,"ratelimit-limit","x-ratelimit-limit"),Q=J0(J);if(Q!==void 0&&Q>0)return Q;let X=AX(Z);if(X===void 0)return;return Y.initial?X+$:Math.max(X+$,Y.limit)},AX=(Y)=>{let Z=PZ(Y,"ratelimit-remaining","x-ratelimit-remaining"),$=J0(Z);return $!==void 0&&$>=0?$:void 0},UX=(Y,Z)=>{let $=s7(Y,PZ(Z,"retry-after"));if($!==void 0)return $;let J=FX(PZ(Z,"ratelimit-reset-after","x-ratelimit-reset-after"));if(J!==void 0)return J;return NX(Y,PZ(Z,"ratelimit-reset","x-ratelimit-reset"))},s7=(Y,Z)=>{if(Z===void 0)return;let $=J0(Z);if($!==void 0)return Y0(IZ($),gY(1));let J=Date.parse(Z);if(Number.isNaN(J))return;let Q=J-Y.currentTimeMillisUnsafe();if(Q<=0)return gY(1);return gY(Q)},FX=(Y)=>{let Z=J0(Y);if(Z===void 0||Z<=0)return;return Y0(IZ(Z),gY(1))},NX=(Y,Z)=>{let $=J0(Z);if($===void 0||$<=0)return;let J=Y.currentTimeMillisUnsafe();if($>1000000000000)return gY(Math.max($-J,1));if($>1e9)return gY(Math.max($*1000-J,1));return Y0(IZ($),gY(1))},J0=(Y)=>{if(Y===void 0)return;let Z=/-?\d+(?:\.\d+)?/.exec(Y);if(Z===null)return;let $=Number(Z[0]);return Number.isFinite($)?$:void 0},PZ=(Y,...Z)=>{for(let $=0;$<Z.length;$++){let J=Y[Z[$]];if(J!==void 0)return J}return},LX=O(2,(Y,Z)=>s(Y,Q1(Z))),MX=O(2,(Y,Z)=>s(Y,x7(Z))),TX=O(2,(Y,Z)=>VY(Y.postprocess,($)=>Q1(Y.preprocess($),Z))),wX=O(2,(Y,Z)=>VY(($)=>Q1(Y.postprocess($),(J)=>o7(Z,(Q)=>Y5(Q,J.cookies))),($)=>U(Y.preprocess($),(J)=>L(a7(Z),(Q)=>o0(Q)?J:HZ(J,"cookie",W7(Q)))))),HX=(Y)=>A5(Y,(Z,$)=>{let J=new AbortController;return Z8.set($,J),$0(c7(()=>WY(()=>J.abort())),Z)}),EX=O((Y)=>r7(Y[0]),(Y,Z)=>VY(($)=>{let J=(Q,X)=>U(Y.postprocess(F(Q)),(G)=>G.status>=300&&G.status<400&&G.headers.location&&X<(Z??10)?J(EZ(Q,new URL(G.headers.location,G.request.url)),X+1):F(G));return U($,(Q)=>J(Q,0))},Y.preprocess)),t7=j("effect/http/HttpClient/TracerDisabledWhen",{defaultValue:()=>$1}),e7=j("effect/HttpClient/TracerPropagationEnabled",{defaultValue:I7}),Y8=j("effect/http/HttpClient/SpanNameGenerator",{defaultValue:()=>(Y)=>`http.client ${Y.method}`}),N5=(Y)=>pY(vZ)(ZY((Z)=>L(Y,($)=>s($,W5((J)=>j7(Z,J)))))),Z1=(()=>{if("FinalizationRegistry"in globalThis&&globalThis.FinalizationRegistry){let Z=new FinalizationRegistry(($)=>{$.abort()});return{register($,J){Z.register($,J,$)},unregister($){Z.unregister($)}}}let Y=new Map;return{register(Z,$){Y.set(Z,setTimeout(()=>$.abort(),5000))},unregister(Z){let $=Y.get(Z);if($===void 0)return;clearTimeout($),Y.delete(Z)}}})(),Z8=new WeakMap;class z5{original;controller;constructor(Y,Z){this.original=Y,this.controller=Z}[zZ]=zZ;[c]=c;applyInterrupt(Y){return _Z(()=>{return Z1.unregister(this.original),d7(Y,()=>WY(()=>{this.controller.abort()}))})}get request(){return this.original.request}get status(){return this.original.status}get headers(){return this.original.headers}get cookies(){return this.original.cookies}get remoteAddress(){return this.original.remoteAddress}get formData(){return this.applyInterrupt(this.original.formData)}get text(){return this.applyInterrupt(this.original.text)}get json(){return this.applyInterrupt(this.original.json)}get urlParamsBody(){return this.applyInterrupt(this.original.urlParamsBody)}get arrayBuffer(){return this.applyInterrupt(this.original.arrayBuffer)}get stream(){return p7(()=>{return Z1.unregister(this.original),n7(this.original.stream,WY(()=>{this.controller.abort()}))})}toJSON(){return this.original.toJSON()}[hY](){return this.original[hY]()}pipe(){return vY(this,arguments)}}var E7=(Y)=>S7(Y)||IX(Y),IX=(Y)=>P0(Y)&&(Y.reason._tag==="TransportError"||Y.reason._tag==="StatusCodeError"&&$8(Y.reason.response)),PX=(Y)=>P0(Y)&&Y.reason._tag==="StatusCodeError"&&Y.reason.response.status===429,$8=(Y)=>Y.status===408||Y.status===429||Y.status===500||Y.status===502||Y.status===503||Y.status===504;var X8={};kY(X8,{layer:()=>vX,RequestInit:()=>L5,Fetch:()=>Q8});var Q8=j("effect/http/FetchHttpClient/Fetch",{defaultValue:()=>globalThis.fetch});class L5 extends S()("effect/http/FetchHttpClient/RequestInit"){}var jX=U5((Y,Z,$,J)=>{let Q=J.getRef(Q8),X=J.context.mapUnsafe.get(L5.key)??{},G=X.headers?fZ(C(X.headers),Y.headers):Y.headers,K=(z)=>L(d({try:()=>Q(Z,{...X,method:Y.method,headers:G,body:z,duplex:Y.body._tag==="Stream"?"half":void 0,signal:$}),catch:(_)=>new x({reason:new j0({request:Y,cause:_})})}),(_)=>J5(Y,_));switch(Y.body._tag){case"Raw":case"Uint8Array":return K(Y.body.body);case"FormData":return K(Y.body.formData);case"Stream":return U(J8(Y.body.stream),K)}return K(void 0)}),vX=N5(F(jX));var qJ={};kY(qJ,{use:()=>SJ,toWebHandler:()=>H2,toHttpEffect:()=>A2,serve:()=>w2,schemaPathParams:()=>O2,schemaParams:()=>B2,schemaNoBody:()=>_2,schemaJson:()=>z2,route:()=>gJ,provideRequest:()=>T2,prefixRoute:()=>CJ,prefixPath:()=>T0,params:()=>RJ,middleware:()=>R1,make:()=>vJ,layer:()=>xZ,disableLogger:()=>M2,cors:()=>L2,addAll:()=>W2,add:()=>D2,RouterConfig:()=>v1,RouteContext:()=>WZ,HttpRouter:()=>LY});var G8=/\+/g,K8=function(){};K8.prototype=Object.create(null);function V8(Y){let Z=new K8;if(typeof Y!=="string")return Z;let $=Y.length,J="",Q="",X=-1,G=-1,K=!1,z=!1,_=!1,B=!1,V=!1,D=0;for(let A=0;A<$+1;A++)if(D=A!==$?Y.charCodeAt(A):38,D===38){if(V=G>X,!V)G=A;if(J=Y.slice(X+1,G),V||J.length>0){if(_)J=J.replace(G8," ");if(K)try{J=decodeURIComponent(J)||J}catch{}if(V){if(Q=Y.slice(G+1,A),B)Q=Q.replace(G8," ");if(z)try{Q=decodeURIComponent(Q)||Q}catch{}}let W=Z[J];if(W===void 0)Z[J]=Q;else if(W.pop)W.push(Q);else Z[J]=[W,Q]}Q="",X=A,G=A,K=!1,z=!1,_=!1,B=!1}else if(D===61)if(G<=X)G=A;else z=!0;else if(D===43)if(G>X)B=!0;else _=!0;else if(D===37)if(G>X)z=!0;else K=!0;return Z}var SX=/^https?:\/\/.*?\//,M5=/(\/:[^/()]*?)\?(\/?)/,O8=(Y={})=>new D8(Y);class D8{constructor(Y={}){this.options={ignoreTrailingSlash:!0,ignoreDuplicateSlashes:!0,caseSensitive:!1,maxParamLength:100,...Y}}options;routes=[];trees={};on(Y,Z,$){let J=Z.match(M5);if(J&&J.index!==void 0){gX(Z.length===J.index+J[0].length,"Optional Parameter needs to be the last parameter of the path");let X=Z.replace(M5,"$1$2"),G=Z.replace(M5,"$2");this.on(Y,X,$),this.on(Y,G,$);return}if(this.options.ignoreDuplicateSlashes)Z=z8(Z);if(this.options.ignoreTrailingSlash)Z=_8(Z);let Q=typeof Y==="string"?[Y]:Y;for(let X of Q)this._on(X,Z,$)}all(Y,Z){this.on(kX,Y,Z)}_on(Y,Z,$){if(this.trees[Y]===void 0)this.trees[Y]=new Q0("/");let J=Z;if(J==="*"&&this.trees[Y].prefix.length!==0){let z=this.trees[Y];this.trees[Y]=new Q0(""),this.trees[Y].staticChildren["/"]=z}let Q=this.trees[Y].prefix.length,X=this.trees[Y],G=[];for(let z=0;z<=J.length;z++){if(J.charCodeAt(z)===58&&J.charCodeAt(z+1)===58){z++;continue}let _=J.charCodeAt(z)===58&&J.charCodeAt(z+1)!==58,B=J.charCodeAt(z)===42;if(_||B||z===J.length&&z!==Q){let V=J.slice(Q,z);if(!this.options.caseSensitive)V=V.toLowerCase();V=V.split("::").join(":"),V=V.split("%").join("%25"),X=X.createStaticChild(V)}if(_){let V=!1,D=[],A=z+1;for(let W=A;;W++){let N=J.charCodeAt(W),T=N===40,E=N===45||N===46,YY=N===47||W===J.length;if(T||E||YY){let I=J.slice(A,W);if(G.push(I),V=V||T||E,T){let yY=bX(J,W),w0=J.slice(W,yY+1);D.push(qX(w0)),W=yY+1}else D.push("(.*?)");let p=W;for(;W<J.length;W++){let yY=J.charCodeAt(W);if(yY===47)break;if(yY===58)if(J.charCodeAt(W+1)===58)W++;else break}let w=J.slice(p,W);if(w)w=w.split("::").join(":"),w=w.split("%").join("%25"),D.push(xX(w));if(A=W+1,YY||J.charCodeAt(W)===47||W===J.length){let yY=V?"()"+w:w,w0=J.slice(z,W);J=J.slice(0,z+1)+yY+J.slice(W),z+=yY.length;let xJ=V?new RegExp("^"+D.join("")+"$"):void 0;X=X.createParametricChild(xJ,w,w0),Q=z+1;break}}}}else if(B){if(G.push("*"),X=X.createWildcardChild(),Q=z+1,z!==J.length-1)throw Error("Wildcard must be the last character in the route")}}if(!this.options.caseSensitive)J=J.toLowerCase();if(J==="*")J="/*";for(let z of this.routes)if(z.method===Y&&z.pattern===J)throw Error(`Method '${Y}' already declared for route '${J}'`);let K={method:Y,path:Z,pattern:J,params:G,handler:$};this.routes.push(K),X.addRoute(K)}has(Y,Z){let $=this.trees[Y];if($===void 0)return!1;let J=$.getStaticChild(Z);if(J===void 0)return!1;return J.isLeafNode}find(Y,Z){let $=this.trees[Y];if($===void 0)return;if(Z.charCodeAt(0)!==47)Z=Z.replace(SX,"/");if(this.options.ignoreDuplicateSlashes)Z=z8(Z);let J,Q,X;try{J=yX(Z),Z=J.path,Q=J.querystring,X=J.shouldDecodeParam}catch(D){return}if(this.options.ignoreTrailingSlash)Z=_8(Z);let G=Z;if(this.options.caseSensitive===!1)Z=Z.toLowerCase();let K=this.options.maxParamLength,z=$.prefix.length,_=[],B=Z.length,V=[];while(!0){if(z===B&&$.isLeafNode){let A=$.handlerStorage?.find();if(A!==void 0)return{handler:A.handler,params:A.createParams(_),searchParams:V8(Q)}}let D=$.getNextNode(Z,z,V,_.length);if(D===void 0){if(V.length===0)return;let A=V.pop();z=A.brotherPathIndex,_.splice(A.paramsCount),D=A.brotherNode}if($=D,$._tag==="StaticNode"){z+=$.prefix.length;continue}if($._tag==="WildcardNode"){let A=G.slice(z);if(X)A=B8(A);_.push(A),z=B;continue}if($._tag==="ParametricNode"){let A=G.indexOf("/",z);if(A===-1)A=B;let W=G.slice(z,A);if(X)W=B8(W);if($.regex!==void 0){let N=$.regex.exec(W);if(N===null)continue;for(let T=1;T<N.length;T++){let E=N[T];if(E.length>K)return;_.push(E)}}else{if(W.length>K)return;_.push(W)}z=A}}}}class W8{handlers=[];unconstrainedHandler;find(){return this.unconstrainedHandler}add(Y){let Z={params:Y.params,handler:Y.handler,createParams:CX(Y.params)};this.handlers.push(Z),this.unconstrainedHandler=this.handlers[0]}}class T5{isLeafNode=!1;routes;handlerStorage;addRoute(Y){if(this.routes===void 0)this.routes=[Y];else this.routes.push(Y);if(this.handlerStorage===void 0)this.handlerStorage=new W8;this.isLeafNode=!0,this.handlerStorage.add(Y)}}class w5 extends T5{staticChildren={};findStaticMatchingChild(Y,Z){let $=this.staticChildren[Y.charAt(Z)];if($===void 0||!$.matchPrefix(Y,Z))return;return $}getStaticChild(Y,Z=0){if(Y.length===Z)return this;let $=this.findStaticMatchingChild(Y,Z);if($===void 0)return;return $.getStaticChild(Y,Z+$.prefix.length)}createStaticChild(Y){if(Y.length===0)return this;let Z=this.staticChildren[Y.charAt(0)];if(Z){let J=1;for(;J<Z.prefix.length;J++)if(Y.charCodeAt(J)!==Z.prefix.charCodeAt(J)){Z=Z.split(this,J);break}return Z.createStaticChild(Y.slice(J))}let $=Y.charAt(0);return this.staticChildren[$]=new Q0(Y),this.staticChildren[$]}}class Q0 extends w5{_tag="StaticNode";constructor(Y){super();this.setPrefix(Y)}prefix;matchPrefix;parametricChildren=[];wildcardChild;setPrefix(Y){if(this.prefix=Y,Y.length===1)this.matchPrefix=(Z,$)=>!0;else{let Z=Y.length;this.matchPrefix=function($,J){for(let Q=1;Q<Z;Q++)if($.charCodeAt(J+Q)!==this.prefix.charCodeAt(Q))return!1;return!0}}}getParametricChild(Y){if(Y===void 0)return this.parametricChildren.find(($)=>$.isRegex===!1);let Z=Y.source;return this.parametricChildren.find(($)=>{if($.regex===void 0)return!1;return $.regex.source===Z})}createParametricChild(Y,Z,$){let J=this.getParametricChild(Y);if(J!==void 0)return J.nodePaths.add($),J;return J=new A8(Y,Z,$),this.parametricChildren.push(J),this.parametricChildren.sort((Q,X)=>{if(!Q.isRegex)return 1;if(!X.isRegex)return-1;if(Q.staticSuffix===void 0)return 1;if(X.staticSuffix===void 0)return-1;if(X.staticSuffix.endsWith(Q.staticSuffix))return 1;if(Q.staticSuffix.endsWith(X.staticSuffix))return-1;return 0}),J}createWildcardChild(){if(this.wildcardChild===void 0)this.wildcardChild=new U8;return this.wildcardChild}split(Y,Z){let $=this.prefix.slice(0,Z),J=this.prefix.slice(Z);this.setPrefix(J);let Q=new Q0($);return Q.staticChildren[J.charAt(0)]=this,Y.staticChildren[$.charAt(0)]=Q,Q}getNextNode(Y,Z,$,J){let Q=this.findStaticMatchingChild(Y,Z),X=0;if(Q===void 0){if(this.parametricChildren.length===0)return this.wildcardChild;Q=this.parametricChildren[0],X=1}if(this.wildcardChild!==void 0)$.push({paramsCount:J,brotherPathIndex:Z,brotherNode:this.wildcardChild});for(let G=this.parametricChildren.length-1;G>=X;G--)$.push({paramsCount:J,brotherPathIndex:Z,brotherNode:this.parametricChildren[G]});return Q}}class A8 extends w5{regex;staticSuffix;_tag="ParametricNode";constructor(Y,Z,$){super();this.regex=Y,this.staticSuffix=Z,this.isRegex=!!Y,this.nodePaths=new Set([$])}isRegex;nodePaths;getNextNode(Y,Z){return this.findStaticMatchingChild(Y,Z)}}class U8 extends T5{_tag="WildcardNode";getNextNode(Y,Z,$,J){return}}var gX=(Y,Z)=>{if(!Y)throw Error(Z)};function z8(Y){return Y.replace(/\/\/+/g,"/")}function _8(Y){if(Y.length>1&&Y.charCodeAt(Y.length-1)===47)return Y.slice(0,-1);return Y}function CX(Y){let Z=Y.length;return function($){let J={};for(let Q=0;Q<Z;Q++)J[Y[Q]]=$[Q];return J}}function bX(Y,Z){let $=1;while(Z<Y.length){if(Z++,Y[Z]==="\\"){Z++;continue}if(Y[Z]===")")$--;else if(Y[Z]==="(")$++;if(!$)return Z}throw TypeError('Invalid regexp expression in "'+Y+'"')}function qX(Y){if(Y.charCodeAt(1)===94)Y=Y.slice(0,1)+Y.slice(2);if(Y.charCodeAt(Y.length-2)===36)Y=Y.slice(0,Y.length-2)+Y.slice(Y.length-1);return Y}function xX(Y){return Y.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function F8(Y,Z){if(Y===50){if(Z===53)return"%";if(Z===51)return"#";if(Z===52)return"$";if(Z===54)return"&";if(Z===66)return"+";if(Z===98)return"+";if(Z===67)return",";if(Z===99)return",";if(Z===70)return"/";if(Z===102)return"/";return}if(Y===51){if(Z===65)return":";if(Z===97)return":";if(Z===66)return";";if(Z===98)return";";if(Z===68)return"=";if(Z===100)return"=";if(Z===70)return"?";if(Z===102)return"?";return}if(Y===52&&Z===48)return"@";return}function yX(Y){let Z=!1,$=!1,J="";for(let X=1;X<Y.length;X++){let G=Y.charCodeAt(X);if(G===37){let K=Y.charCodeAt(X+1),z=Y.charCodeAt(X+2);if(F8(K,z)===void 0)Z=!0;else{if($=!0,K===50&&z===53)Z=!0,Y=Y.slice(0,X+1)+"25"+Y.slice(X+1),X+=2;X+=2}}else if(G===63||G===59||G===35){J=Y.slice(X+1),Y=Y.slice(0,X);break}}return{path:Z?decodeURI(Y):Y,querystring:J,shouldDecodeParam:$}}function B8(Y){let Z=Y.indexOf("%");if(Z===-1)return Y;let $="",J=Z;for(let Q=Z;Q<Y.length;Q++)if(Y.charCodeAt(Q)===37){let X=Y.charCodeAt(Q+1),G=Y.charCodeAt(Q+2),K=F8(X,G);$+=Y.slice(J,Q)+K,J=Q+3}return Y.slice(0,Z)+$+Y.slice(J)}var kX=["ACL","BIND","CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LINK","LOCK","M-SEARCH","MERGE","MKACTIVITY","MKCALENDAR","MKCOL","MOVE","NOTIFY","OPTIONS","PATCH","POST","PROPFIND","PROPPATCH","PURGE","PUT","REBIND","REPORT","SEARCH","SOURCE","SUBSCRIBE","TRACE","UNBIND","UNLINK","UNLOCK","UNSUBSCRIBE"];var N8=O8;var H5="~effect/http/HttpServerResponse",AY=(Y)=>q(Y,H5),t=(Y)=>UY({status:Y?.status??204,statusText:Y?.statusText,headers:Y?.headers?C(Y.headers):void 0,cookies:Y?.cookies});var N3=(Y,Z)=>{let $=Z?.headers?C(Z.headers):n;return UY({status:Z?.status??200,statusText:Z?.statusText,headers:$,cookies:Z?.cookies??a0,body:lZ(Y,G0(Z,$))})},G0=(Y,Z)=>{if(Y?.contentType)return Y.contentType;else if(Y?.headers)return Z["content-type"]},L3=(Y,Z)=>{let $=Z?.headers?C(Z.headers):n;return UY({status:Z?.status??200,statusText:Z?.statusText,headers:$,cookies:Z?.cookies??a0,body:uY(Y,G0(Z,$))})};var M3=(Y,Z)=>{let $=Z?.headers?C(Z.headers):n;return UY({status:Z?.status??200,statusText:Z?.statusText,headers:$,cookies:Z?.cookies,body:c0(Y,G0(Z,$))})},T3=(Y,Z)=>{let $=Z?.headers?C(Z.headers):n;return UY({status:Z?.status??200,statusText:Z?.statusText,headers:$,cookies:Z?.cookies,body:uY(f0(a(Y)),G0(Z,$)??"application/x-www-form-urlencoded")})};var j5=(Y,Z)=>{let $=Z?.headers?C(Z.headers):n;return UY({status:Z?.status??200,statusText:Z?.statusText,headers:$,cookies:Z?.cookies,body:jY(Y,G0(Z,$),Z?.contentLength)})};var w3=O(3,(Y,Z,$)=>UY({...Y,headers:HY(Y.headers,Z,$)})),L8=O(2,(Y,Z)=>UY({...Y,headers:b0(Y.headers,Z)}));var H3=O((Y)=>AY(Y[0]),(Y,Z,$,J)=>L(D7(Y.cookies,Z,$,J).asEffect(),(Q)=>UY({...Y,cookies:Q})));var M8=O(2,(Y,Z)=>UY({...Y,body:Z}));var T8=(Y,Z)=>{let $=new globalThis.Headers(Y.headers);if(!o0(Y.cookies)){let Q=A7(Y.cookies);for(let X of Q)$.append("set-cookie",X)}if(Z?.withoutBody)return new Response(void 0,{status:Y.status,statusText:Y.statusText,headers:$});let J=Y.body;switch(J._tag){case"Empty":return new Response(void 0,{status:Y.status,statusText:Y.statusText,headers:$});case"Uint8Array":case"Raw":{if(J.body instanceof Response){for(let[Q,X]of $)J.body.headers.set(Q,X);return J.body}return new Response(J.body,{status:Y.status,statusText:Y.statusText,headers:$})}case"FormData":return new Response(J.formData,{status:Y.status,statusText:Y.statusText,headers:$});case"Stream":return new Response(wZ(J.stream,Z?.context??GZ()),{status:Y.status,statusText:Y.statusText,headers:$})}};var fX={...x0,[H5]:H5,[RZ]:!0,toJSON(){return{_id:"HttpServerResponse",status:this.status,statusText:this.statusText,headers:fY(this.headers),cookies:this.cookies.toJSON(),body:this.body.toJSON()}}},UY=(Y)=>{let Z=Object.create(fX);if(Z.status=Y.status,Z.statusText=Y.statusText,Z.cookies=Y.cookies??a0,Z.body=Y.body??QZ,Z.body._tag!=="Empty"&&(Z.body.contentType||Z.body.contentLength)){let $=wY({...Y.headers});if(Z.body.contentType)$["content-type"]=Z.body.contentType;if(Z.body.contentLength)$["content-length"]=Z.body.contentLength.toString();Z.headers=$}else Z.headers=Y.headers??n;return Z};var oY="~effect/http/HttpServerRespondable",E8=(Y)=>q(Y,oY),cX=t({status:400}),dX=t({status:404});var I8=(Y,Z)=>{if(AY(Y))return F(Y);else if(E8(Y))return K0(Y[oY](),()=>F(Z));else if(H8(Y))return F(cX);else if(w8(Y))return F(dX);return F(Z)},P8=(Y,Z)=>{if(AY(Y))return F(Y);else if(E8(Y))return K0(Y[oY](),()=>F(Z));return F(Z)};var j8="~effect/http/HttpServerError";class l extends P("HttpServerError"){constructor(Y){if("cause"in Y.reason)super({...Y,cause:Y.reason.cause});else super(Y)}[j8]=j8;stack=`${this.name}: ${this.message}`;get request(){return this.reason.request}get response(){return"response"in this.reason?this.reason.response:void 0}[oY](){return this.reason[oY]()}get[RZ](){return this.reason[RZ]??!1}get message(){return this.reason.message}}class JY extends P("RequestParseError"){[oY](){return F(t({status:400}))}get methodAndUrl(){return`${this.request.method} ${this.request.url}`}get message(){return g8(this._tag,this.description,this.methodAndUrl)}}class v5 extends P("RouteNotFound"){[oY](){return F(t({status:404}))}[RZ]=!0;get methodAndUrl(){return`${this.request.method} ${this.request.url}`}get message(){return g8(this._tag,this.description,this.methodAndUrl)}}class _1 extends S()("effect/http/HttpServerError/ClientAbort"){static annotation=this.context(!0).pipe(gZ(S8,{name:"ClientAbort",stack:v8,parent:void 0}))}var g8=(Y,Z,$)=>{let J=`${Y} (${$})`;return Z?`${J}: ${Z}`:J},R5=(Y)=>{let Z,$=lX,J=[],Q=[],X=!1;for(let G=0;G<Y.reasons.length;G++){let K=Y.reasons[G];switch(K._tag){case"Fail":{$=I8(K.error,z1),J.push(K);break}case"Die":{if(AY(K.defect))Z=K.defect;else $=P8(K.defect,z1),J.push(K);break}case"Interrupt":{if(X=K.annotations.has(_1.key),J.length>0)break;Q.push(K);break}}}if(Z)return F([Z,V1(J)]);else if(Q.length>0&&J.length===0)J.push(...Q),$=X?iX:pX;return V0($,(G)=>{return J.push(R8(G)),[G,V1(J)]})},S5=(Y)=>{let Z,$=Y.reasons.filter((J)=>{if(J._tag==="Die"&&AY(J.defect))return Z=J.defect,!1;return!0});return[Z??z1,$.length>0?b(V1($)):H()]},z1=t({status:500}),lX=F(z1),iX=F(t({status:499})),pX=F(t({status:503})),C8=(Y)=>{if(Y._tag==="Success")return Y.value;return S5(Y.cause)[0]};var A0={};kY(A0,{upgradeChannel:()=>E4,toWebResult:()=>u5,toWeb:()=>u4,toURL:()=>W0,toClientRequest:()=>q4,searchParamsFromURL:()=>m$,schemaSearchParams:()=>j4,schemaHeaders:()=>P4,schemaCookies:()=>I4,schemaBodyUrlParams:()=>S4,schemaBodyMultipart:()=>g4,schemaBodyJson:()=>v4,schemaBodyFormJson:()=>C4,schemaBodyForm:()=>R4,fromWeb:()=>f5,fromClientRequest:()=>b4,TypeId:()=>OZ,ParsedSearchParams:()=>xY,MaxBodySize:()=>rZ,HttpServerRequest:()=>M});var B1="~effect/socket/Socket/SocketError",rX=(Y)=>q(Y,B1);class s8 extends tY("effect/socket/Socket/SocketReadError")({_tag:mY("SocketReadError"),cause:AZ}){message="An error occurred during Read"}class t8 extends tY("effect/socket/Socket/SocketWriteError")({_tag:mY("SocketWriteError"),cause:AZ}){message="An error occurred during Write"}class e8 extends tY("effect/socket/Socket/SocketOpenError")({_tag:mY("SocketOpenError"),kind:I0(["Unknown","Timeout"]),cause:AZ}){get message(){return this.kind==="Timeout"?'timeout waiting for "open"':"An error occurred during Open"}}class Y$ extends tY("effect/socket/Socket/SocketCloseError")({_tag:mY("SocketCloseError"),code:o8,closeReason:E0(IY)}){static filterClean(Y){return function(Z){return Z$.is(Z)&&Z.reason._tag==="SocketCloseError"&&Y(Z.reason.code)?PY(Z.reason):h(Z)}}get message(){if(this.closeReason)return`${this.code}: ${this.closeReason}`;return`${this.code}`}}var sX=k0([s8,t8,e8,Y$]);class Z$ extends r8(B1)("SocketError",{_tag:mY("SocketError"),reason:sX}){constructor(Y){if("cause"in Y.reason)super({...Y,cause:Y.reason.cause});else super(Y)}[B1]=B1;static is(Y){return rX(Y)}message=this.reason.message}var tX=(Y,Z)=>D1(_0(function*($,J){let Q=yield*u8(),X=yield*y8(J),G=yield*x8(Y.writer,X),K,z=0,_=h8({while:()=>z<K.length,body:()=>G(K[z++]),step:b8});return yield*$.pipe(U((B)=>{if(B.length===1)return G(B[0]);return K=B,z=0,_}),d8({disableYield:!0}),f8(m8,(B)=>i8(Q,B)),c8(z0(X,O1)),g5(J)),yield*Y.runRaw((B)=>{l8(Q,Z(B))}).pipe(n8(Q),g5(J)),p8(Q)})),eX=(Y)=>{let Z=new TextEncoder;return tX(Y,($)=>typeof $==="string"?Z.encode($):$)};var $$=()=>(Y)=>eX(Y);var J$=/; *([!#$%&'*+.^\w`|~-]+)=("(?:[\v\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\v\u0020-\u00ff])*"|[!#$%&'*+.^\w`|~-]+) */gu,Q$=/\\([\v\u0020-\u00ff])/gu,Z4=/^[!#$%&'*+.^\w|~-]+\/[!#$%&'*+.^\w|~-]+$/u,$4=/^[!#$%&'*+.^\w|~-]+$/u,W1={value:"",parameters:Object.create(null)};function A1(Y,Z=!1){if(typeof Y!=="string")return W1;let $=Y.indexOf(";"),J=$!==-1?Y.slice(0,$).trim():Y.trim();if((Z?$4:Z4).test(J)===!1)return W1;let X={value:J.toLowerCase(),parameters:Object.create(null)};if($===-1)return X;let G,K,z;J$.lastIndex=$;while(K=J$.exec(Y)){if(K.index!==$)return W1;if($+=K[0].length,G=K[1].toLowerCase(),z=K[2],z[0]==='"')z=z.slice(1,z.length-1),!Z&&Q$.test(z)&&(z=z.replace(Q$,"$1"));X.parameters[G]=z}if($!==Y.length)return W1;return X}var QY;(function(Y){Y[Y.key=0]="key",Y[Y.whitespace=1]="whitespace",Y[Y.value=2]="value"})(QY||(QY={}));var B0={_tag:"Continue"},Q4=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,0,0,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1],X4=[0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1];function X$(){let Y=new TextDecoder,Z={state:QY.key,headers:Object.create(null),key:"",value:void 0,crlf:0,previousChunk:void 0,pairs:0,size:0};function $(X){return Z.state=QY.key,Z.headers=Object.create(null),Z.key="",Z.value=void 0,Z.crlf=0,Z.previousChunk=void 0,Z.pairs=0,Z.size=0,X}function J(X,G){let K=new Uint8Array(X.length+G.length);return K.set(X),K.set(G,X.length),K}function Q(X){return $({_tag:"Failure",reason:X,headers:Z.headers})}return function(G,K){let z=0,_;if(Z.previousChunk!==void 0){z=Z.previousChunk.length,_=z;let V=new Uint8Array(G.length+z);V.set(Z.previousChunk),V.set(G,z),Z.previousChunk=void 0,G=V}let B=G.length;Y:while(K<B){if(Z.state===QY.key){let V=K;for(;V<B;V++){if(Z.size++>16384)return Q("HeaderTooLarge");if(G[V]===58){if(Z.key+=Y.decode(G.subarray(K,V)).toLowerCase(),Z.key.length===0)return Q("InvalidHeaderName");if(G[V+1]===32&&G[V+2]!==32&&G[V+2]!==9)K=V+2,Z.state=QY.value,Z.size++;else if(G[V+1]!==32&&G[V+1]!==9)K=V+1,Z.state=QY.value;else K=V+1,Z.state=QY.whitespace;break}else if(Q4[G[V]]!==1)return Q("InvalidHeaderName")}if(V===B)return Z.key+=Y.decode(G.subarray(K,B)).toLowerCase(),B0}if(Z.state===QY.whitespace){for(;K<B;K++){if(Z.size++>16384)return Q("HeaderTooLarge");if(G[K]!==32&&G[K]!==9){Z.state=QY.value;break}}if(K===B)return B0}if(Z.state===QY.value){let V=K;if(_!==void 0)V=_,_=void 0;for(;V<B;V++){if(Z.size++>16384)return Q("HeaderTooLarge");if(G[V]===13||Z.crlf>0){let D=G[V];if(D===13&&Z.crlf===0)Z.crlf=1,V++,Z.size++,D=G[V];if(D===10&&Z.crlf===1)Z.crlf=2,V++,Z.size++,D=G[V];if(D===13&&Z.crlf===2)Z.crlf=3,V++,Z.size++,D=G[V];if(D===10&&Z.crlf===3)Z.crlf=4,V++,Z.size++;if(Z.crlf<4&&V>=B)return Z.previousChunk=G.subarray(K),B0;else if(Z.crlf>=2){Z.value=Z.value===void 0?G.subarray(K,V-Z.crlf):J(Z.value,G.subarray(K,V-Z.crlf));let A=Y.decode(Z.value);if(Z.headers[Z.key]===void 0)Z.headers[Z.key]=A;else if(typeof Z.headers[Z.key]==="string")Z.headers[Z.key]=[Z.headers[Z.key],A];else Z.headers[Z.key].push(A);if(K=V,Z.size--,Z.crlf!==4&&Z.pairs===100)return Q("TooManyHeaders");else if(Z.crlf===3)return Q("InvalidHeaderValue");else if(Z.crlf===4)return $({_tag:"Headers",headers:Z.headers,endPosition:K-z});Z.pairs++,Z.key="",Z.value=void 0,Z.crlf=0,Z.state=QY.key;continue Y}}else if(X4[G[V]]!==1)return Q("InvalidHeaderValue")}if(V===B)return Z.value=Z.value===void 0?G.subarray(K,B):J(Z.value,G.subarray(K,B)),B0}}if(K>B)Z.size+=B-K;return B0}}function K4(Y){let Z=new TextEncoder().encode(Y),$=Z.length,J={};for(let Q=0;Q<$;Q++){let X=Z[Q];if(J[X]===void 0)J[X]=[];J[X].push(Q)}return{needle:Z,needleLength:$,indexes:J,firstByte:Z[0],previousChunk:void 0,previousChunkLength:0,matchIndex:0}}function G$(Y,Z,$){let J=K4(Y);if($!==void 0)J.previousChunk=$,J.previousChunkLength=$.length;function Q(){if("Buffer"in globalThis&&!(("Bun"in globalThis)||("Deno"in globalThis)))return function(_,B,V){return Buffer.prototype.indexOf.call(_,B,V)};let z=new Uint8Array(256).fill(J.needle.length);for(let _=0,B=J.needle.length-1;_<B;++_)z[J.needle[_]]=B-_;return function(_,B,V){let D=_.length,A=V+J.needleLength-1;while(A<D){for(let W=J.needleLength-1,N=A;W>=0&&_[N]===B[W];W--,N--)if(W===0)return N;A+=z[_[A]]}return-1}}let X=Q();function G(z){let _=z.length;if(J.previousChunk!==void 0){let V=new Uint8Array(J.previousChunkLength+_);V.set(J.previousChunk),V.set(z,J.previousChunkLength),z=V,_=J.previousChunkLength+_,J.previousChunk=void 0}if(_<J.needleLength){J.previousChunk=z,J.previousChunkLength=_;return}let B=0;while(B<_){let V=X(z,J.needle,B);if(V>-1){if(V>B)Z(J.matchIndex,z.subarray(B,V));J.matchIndex+=1,B=V+J.needleLength;continue}else if(z[_-1]in J.indexes){let D=J.indexes[z[_-1]],A=-1;for(let W=0,N=D.length;W<N;W++){let T=D[W];if(z[_-1-T]===J.firstByte&&W>A)A=T}if(A===-1)if(B===0)Z(J.matchIndex,z);else Z(J.matchIndex,z.subarray(B));else{if(_-1-A>B)Z(J.matchIndex,z.subarray(B,_-1-A));J.previousChunk=z.subarray(_-1-A),J.previousChunkLength=A+1}}else if(B===0)Z(J.matchIndex,z);else Z(J.matchIndex,z.subarray(B));break}}function K(){if(J.previousChunk!==void 0&&J.previousChunk!==$)Z(J.matchIndex,J.previousChunk);J.previousChunk=$,J.previousChunkLength=$?.length??0,J.matchIndex=0}return{write:G,end:K}}var CY;(function(Y){Y[Y.headers=0]="headers",Y[Y.body=1]="body"})(CY||(CY={}));var z4={_tag:"InvalidDisposition"},_4={_tag:"EndNotReached"},B4={_tag:"ReachedLimit",limit:"MaxParts"},O4={_tag:"ReachedLimit",limit:"MaxTotalSize"},D4={_tag:"ReachedLimit",limit:"MaxPartSize"},K$={_tag:"ReachedLimit",limit:"MaxFieldSize"},W4=new TextEncoder().encode(`\r
|
|
2
|
+
import{MA as a7,NA as o7,tA as RZ}from"./chunk-pqnbdygz.js";import{$B as g0,$D as U6,$F as z0,$I as g1,$K as T$,$N as k1,AH as x7,AL as n7,AP as tY,BC as B6,BF as F$,BP as r8,CB as _5,CC as hZ,CF as x5,CH as D5,CI as o,CK as C5,CL as w$,CP as LZ,DF as O1,DK as M$,EL as H$,EN as IY,FG as N$,FN as o8,GG as m8,GI as _0,HH as y7,ID as G7,IG as g7,IH as k7,IL as P5,JD as K7,JI as F0,JL as wZ,KG as C7,KH as m7,KL as J8,LH as h7,MD as V7,MI as l5,ML as O0,MN as I$,ND as z6,NI as a$,NL as dY,NN as w6,OH as $J,PB as q,PC as H,PH as jZ,PL as OJ,PN as H6,QC as b,QD as y0,QF as p$,QH as f7,RB as P7,RC as y$,RG as FY,RH as E5,RM as D0,RN as y1,SC as r,SD as b1,SH as ZY,SI as V0,SN as E6,TB as S0,TC as BY,TD as W6,TF as L0,TH as J6,TI as bZ,TN as k0,UC as L1,UG as h8,UM as m6,UN as I0,VD as q5,VF as a5,VL as E$,WC as l1,WD as A6,WF as x8,WG as d,WH as W5,WL as DJ,XD as wJ,XG as F,XN as cY,YB as K6,YC as XZ,YD as HJ,YG as _Z,ZB as _6,ZC as O6,ZF as y8,ZG as WY,ZN as mY,_G as e,_I as i0,_J as nY,aD as S,aG as YJ,aI as c7,aP as AZ,bD as bY,bE as F6,bI as c8,bJ as L6,cC as V6,cD as e$,cH as i,cI as w1,cJ as M6,cL as K1,dC as fY,dD as GZ,dE as aZ,dF as i$,dG as EJ,dH as g,dL as I5,eD as gZ,eE as z7,eG as H1,eH as eZ,eI as OY,eL as p7,fC as k6,fE as v7,fG as Z6,fH as BJ,fL as tZ,gG as ZJ,gH as GY,gI as jJ,gL as k$,hD as zY,hG as M0,hI as d7,iC as hY,iD as y,iE as gY,iF as p5,iG as IJ,iH as u,iI as JJ,iL as SY,jE as IZ,jF as V1,jH as U,jI as K5,jN as x1,kD as j7,kG as pY,kI as d8,kJ as T6,kK as u8,kL as $5,kN as F7,lC as _Y,lE as _7,lG as $6,lH as $0,lI as u7,lJ as q1,lN as H8,mC as RY,mD as j,mE as Y0,mF as R8,mG as DZ,mH as Q1,mP as I6,nE as B5,nG as PJ,nK as l8,nN as f,nP as P$,oD as PY,oG as _J,oH as n$,oI as l7,oK as i8,oN as iY,pB as vY,pC as x0,pD as h,pF as G5,pG as rY,pH as L,qG as sY,qI as i7,rB as O,rD as a6,rI as g5,rK as p8,rL as X0,sB as BZ,tD as iZ,tF as w8,tH as b7,tK as n8,tN as E0,uB as DY,uD as o6,uE as T1,uF as A$,uG as n0,uH as X1,vB as I7,vD as X7,vF as U$,vG as P,vH as q7,vI as QJ,vL as h5,wB as $1,wE as Y1,wF as S7,wH as K0,xB as v8,xE as R7,xG as J1,xH as f8,yB as b8,yD as D6,yF as S8,yH as JZ,yI as n5,yK as D1,zB as Y6,zK as L$,zL as XJ}from"./chunk-ydc6ypjt.js";import{iQ as kY}from"./chunk-4sazy0nq.js";var mZ={};kY(mZ,{isHttpClientError:()=>P0,TransportError:()=>j0,StatusCodeError:()=>kZ,InvalidUrlError:()=>v0,HttpClientErrorSchema:()=>S1,HttpClientError:()=>x,EncodeError:()=>X6,EmptyBodyError:()=>R0,DecodeError:()=>TY});var H0="~effect/http/HttpClientError",P0=(Y)=>q(Y,H0);class x extends P("HttpClientError"){constructor(Y){if("cause"in Y.reason)super({...Y,cause:Y.reason.cause});else super(Y)}[H0]=H0;get request(){return this.reason.request}get response(){return"response"in this.reason?this.reason.response:void 0}get message(){return this.reason.message}}var UZ=(Y)=>Y.endsWith("Error")?Y.slice(0,-5):Y,FZ=(Y,Z,$)=>Z?`${Y}: ${Z} (${$})`:`${Y} error (${$})`;class j0 extends P("TransportError"){get methodAndUrl(){return`${this.request.method} ${this.request.url}`}get message(){return FZ(UZ(this._tag),this.description,this.methodAndUrl)}}class X6 extends P("EncodeError"){get methodAndUrl(){return`${this.request.method} ${this.request.url}`}get message(){return FZ(UZ(this._tag),this.description,this.methodAndUrl)}}class v0 extends P("InvalidUrlError"){get methodAndUrl(){return`${this.request.method} ${this.request.url}`}get message(){return FZ(UZ(this._tag),this.description,this.methodAndUrl)}}class kZ extends P("StatusCodeError"){get methodAndUrl(){return`${this.request.method} ${this.request.url}`}get message(){let Y=`${this.response.status} ${this.methodAndUrl}`;return FZ(UZ(this._tag),this.description,Y)}}class TY extends P("DecodeError"){get methodAndUrl(){return`${this.request.method} ${this.request.url}`}get message(){let Y=`${this.response.status} ${this.methodAndUrl}`;return FZ(UZ(this._tag),this.description,Y)}}class R0 extends P("EmptyBodyError"){get methodAndUrl(){return`${this.request.method} ${this.request.url}`}get message(){let Y=`${this.response.status} ${this.methodAndUrl}`;return FZ(UZ(this._tag),this.description,Y)}}class S1 extends tY(H0)({_tag:mY("HttpError"),kind:I0(["EncodeError","DecodeError","TransportError","InvalidUrlError","StatusCodeError","EmptyBodyError"]),cause:E0(AZ)}){static fromHttpClientError(Y){return new S1({_tag:"HttpError",kind:Y.reason._tag,cause:Y.reason})}}var pZ={};kY(pZ,{updateUrl:()=>zQ,trace:()=>XQ,toWebResult:()=>Z7,toWeb:()=>vQ,toUrl:()=>o1,setUrlParams:()=>e6,setUrlParam:()=>_Q,setUrl:()=>EZ,setMethod:()=>r6,setHeaders:()=>p0,setHeader:()=>HZ,setHash:()=>Y7,setBody:()=>$Y,schemaBodyJson:()=>NQ,removeHash:()=>DQ,put:()=>ZQ,prependUrl:()=>a1,post:()=>eJ,patch:()=>YQ,options:()=>QQ,modify:()=>p1,makeWith:()=>R,make:()=>KY,isHttpClientRequest:()=>KZ,head:()=>JQ,get:()=>tJ,fromWeb:()=>EQ,empty:()=>i1,delete:()=>$Q,bodyUrlParams:()=>LQ,bodyUint8Array:()=>WQ,bodyText:()=>AQ,bodyStream:()=>wQ,bodyJsonUnsafe:()=>FQ,bodyJson:()=>UQ,bodyFormDataRecord:()=>TQ,bodyFormData:()=>MQ,bodyFile:()=>HQ,bearerToken:()=>KQ,basicAuth:()=>GQ,appendUrlParams:()=>OQ,appendUrlParam:()=>BQ,appendUrl:()=>VQ,acceptJson:()=>s6,accept:()=>n1});var G6=Symbol.for("~effect/http/Headers");var NZ=Object.create(null);Object.defineProperties(NZ,{[G6]:{value:G6},[V6]:{value(Y){return YZ(this,y(Y,cZ))}},toJSON:{value(){return fY(this)}},[g0]:{value(Y){return fJ(this,Y)}},[S0]:{value(){return K6(this)}},toString:{value:_Y.toString},[hY]:{value:_Y[hY]}});var C0=(Y)=>Object.assign(Object.create(NZ),Y),fJ=z6(hZ());var n=Object.create(NZ),C=(Y)=>{if(Y===void 0)return n;else if(Symbol.iterator in Y){let $=Object.create(NZ);for(let[J,Q]of Y)$[J.toLowerCase()]=Q;return $}let Z=Object.create(NZ);for(let[$,J]of Object.entries(Y))if(Array.isArray(J))Z[$.toLowerCase()]=J.join(", ");else if(J!==void 0)Z[$.toLowerCase()]=J;return Z},wY=(Y)=>Object.setPrototypeOf(Y,NZ);var HY=O(3,(Y,Z,$)=>{let J=C0(Y);return J[Z.toLowerCase()]=$,J}),b0=O(2,(Y,Z)=>C0({...Y,...C(Z)})),fZ=O(2,(Y,Z)=>{let $=C0(Y);return Object.assign($,Z),$}),q0=O(2,(Y,Z)=>{let $=C0(Y);return delete $[Z.toLowerCase()],$});var YZ=O(2,(Y,Z)=>{let $={...Y},J=(Q)=>{if(typeof Q==="string"){let X=Q.toLowerCase();if(X in Y)$[X]=g1(Y[X])}else for(let X in Y)if(Q.test(X))$[X]=g1(Y[X])};if(Array.isArray(Z))for(let Q=0;Q<Z.length;Q++)J(Z[Q]);else J(Z);return $}),cZ=j("effect/Headers/CurrentRedactedNames",{defaultValue:()=>["authorization","cookie","set-cookie","x-api-key"]});var C1="~effect/http/UrlParams",cJ=(Y)=>q(Y,C1),dJ={...x0,[C1]:C1,[Symbol.iterator](){return this.params[Symbol.iterator]()},toJSON(){return{_id:"UrlParams",params:Object.fromEntries(this.params)}},[g0](Y){return j6(this,Y)},[S0](){return _6(this.params.flat())}},ZZ=(Y)=>{let Z=Object.create(dJ);return Z.params=Y,Z},a=(Y)=>{let Z=P6(Y),$=[];for(let J=0;J<Z.length;J++)if(Array.isArray(Z[J][0])){let[Q,X]=Z[J];$.push([`${Q[0]}[${Q.slice(1).join("][")}]`,X])}else $.push(Z[J]);return ZZ($)},P6=(Y)=>{let Z=typeof Y[Symbol.iterator]==="function"?y0(Y):Object.entries(Y),$=[];for(let[J,Q]of Z)if(Array.isArray(Q)){for(let X=0;X<Q.length;X++)if(Q[X]!==void 0)$.push([J,String(Q[X])])}else if(typeof Q==="object"){let X=P6(Q);for(let[G,K]of X)$.push([[J,...typeof G==="string"?[G]:G],K])}else if(Q!==void 0)$.push([J,String(Q)]);return $},j6=B6((Y,Z)=>uJ(Y.params,Z.params)),uJ=F6(D6([hZ(),hZ()])),v6=x1(cJ,{typeConstructor:{_tag:"effect/http/UrlParams"},generation:{runtime:"UrlParams.UrlParamsSchema",Type:"UrlParams.UrlParams",Encoded:'typeof UrlParams.UrlParamsSchema["Encoded"]',importDeclaration:'import * as UrlParams from "effect/unstable/http/UrlParams"'},expected:"UrlParams",toEquivalence:()=>j6,toCodec:()=>k1()(y1(H6([IY,IY])),q1({decode:ZZ,encode:(Y)=>Y.params}))}),m0=ZZ([]);var lJ=O(2,(Y,Z)=>A6(Y.params,([$])=>$===Z).pipe(O6(([,$])=>$)));var R6=O(3,(Y,Z,$)=>ZZ(b1(U6(Y.params,([J])=>J!==Z),[Z,String($)]))),iJ=O(2,(Y,Z)=>ZZ(Z(Y.params))),S6=O(2,(Y,Z)=>{let $=a(Z),J=$.params,Q=new Set;for(let X=0;X<J.length;X++)Q.add(J[X][0]);for(let X=0;X<Y.params.length;X++){if(Q.has(Y.params[X][0]))continue;J.push(Y.params[X])}return $}),g6=O(3,(Y,Z,$)=>ZZ(b1(Y.params,[Z,String($)]))),C6=O(2,(Y,Z)=>iJ(Y,W6(a(Z).params)));class h0 extends P("UrlParamsError"){}var uZ=(Y,Z,$)=>{try{let J=new URL(Y,pJ());for(let Q=0;Q<Z.params.length;Q++){let[X,G]=Z.params[Q];if(G!==void 0)J.searchParams.append(X,G)}if($!==void 0)J.hash=$;return PY(J)}catch(J){return h(new h0({cause:J}))}},f0=(Y)=>new URLSearchParams(Y.params).toString(),pJ=()=>{if("location"in globalThis&&globalThis.location!==void 0&&globalThis.location.origin!==void 0&&globalThis.location.pathname!==void 0)return location.origin+location.pathname;return},nJ=(Y)=>{let Z={};for(let[$,J]of Y.params){let Q=Z[$];if(Q===void 0)Z[$]=J;else if(typeof Q==="string")Z[$]=[Q,J];else Q.push(J)}return Z},aJ=nJ,b6=(Y)=>v6.pipe(cY(I6,T6({decode:(Z)=>BY(lJ(Z,Y),{onNone:()=>g(new L6([Y],new M6(void 0))),onSome:F}),encode:(Z)=>F(ZZ([[Y,Z]]))}))),q6=v6.pipe(cY(w6(IY,k0([IY,E6(IY)])),q1({decode:aJ,encode:a})));var m1="~effect/http/HttpBody";var x6="~effect/http/HttpBody/HttpBodyError";class f1 extends P("HttpBodyError"){[x6]=x6}class MZ{[m1];constructor(){this[m1]=m1}[hY](){return this.toJSON()}toString(){return k6(this,{ignoreToString:!0})}}class h6 extends MZ{_tag="Empty";toJSON(){return{_id:"effect/HttpBody",_tag:"Empty"}}}var QZ=new h6;class f6 extends MZ{_tag="Raw";body;contentType;contentLength;constructor(Y,Z,$){super();this.body=Y,this.contentType=Z,this.contentLength=$}toJSON(){return{_id:"effect/HttpBody",_tag:"Raw",body:this.body,contentType:this.contentType,contentLength:this.contentLength}}}var c1=(Y,Z)=>new f6(Y,Z?.contentType,Z?.contentLength);class c6 extends MZ{_tag="Uint8Array";body;contentType;contentLength;constructor(Y,Z,$){super();this.body=Y,this.contentType=Z,this.contentLength=$}toJSON(){return{_id:"effect/HttpBody",_tag:"Uint8Array",body:this.contentType.startsWith("text/")||this.contentType.endsWith("json")?new TextDecoder().decode(this.body):`Uint8Array(${this.body.length})`,contentType:this.contentType,contentLength:this.contentLength}}}var lZ=(Y,Z)=>new c6(Y,Z??"application/octet-stream",Y.length),oJ=new TextEncoder,uY=(Y,Z)=>lZ(oJ.encode(Y),Z??"text/plain"),c0=(Y,Z)=>uY(JSON.stringify(Y),Z??"application/json"),d0=(Y,Z)=>GY({try:()=>uY(JSON.stringify(Y),Z??"application/json"),catch:($)=>new f1({reason:{_tag:"JsonError"},cause:$})}),d1=(Y,Z)=>{let $=m6(LZ(Y));return(J,Q)=>$(J,Z).pipe(JZ((X)=>new f1({reason:{_tag:"SchemaError",issue:X},cause:X})),U((X)=>d0(X,Q)))},d6=(Y,Z)=>uY(f0(Y),Z??"application/x-www-form-urlencoded");class u6 extends MZ{_tag="FormData";contentType=void 0;contentLength=void 0;formData;constructor(Y){super();this.formData=Y}toJSON(){return{_id:"effect/HttpBody",_tag:"FormData",formData:this.formData}}}var u0=(Y)=>new u6(Y),y6=(Y,Z,$)=>{if($==null)return;if(typeof $==="object"){Y.append(Z,$);return}Y.append(Z,String($))},l6=(Y)=>{let Z=new globalThis.FormData;for(let[$,J]of Object.entries(Y))if(Array.isArray(J))for(let Q of J)y6(Z,$,Q);else y6(Z,$,J);return u0(Z)};class i6 extends MZ{_tag="Stream";stream;contentType;contentLength;constructor(Y,Z,$){super();this.stream=Y,this.contentType=Z,this.contentLength=$}toJSON(){return{_id:"effect/HttpBody",_tag:"Stream",contentType:this.contentType,contentLength:this.contentLength}}}var jY=(Y,Z,$)=>new i6(Y,Z??"application/octet-stream",$),p6=(Y,Z)=>U(dY.asEffect(),($)=>L($.stat(Y),(J)=>jY($.stream(Y,Z),Z?.contentType,Number(J.size))));var TZ=(Y)=>Y!=="GET"&&Y!=="HEAD"&&Y!=="OPTIONS"&&Y!=="TRACE";var n6=[["GET","get"],["POST","post"],["PUT","put"],["DELETE","del"],["PATCH","patch"],["HEAD","head"],["OPTIONS","options"],["TRACE","trace"]];var u1="~effect/http/HttpClientRequest",KZ=(Y)=>q(Y,u1),sJ={[u1]:u1,..._Y,toJSON(){return{_id:"HttpClientRequest",method:this.method,url:this.url,urlParams:this.urlParams,hash:this.hash,headers:fY(this.headers),body:this.body.toJSON()}},pipe(){return vY(this,arguments)}};function R(Y,Z,$,J,Q,X){let G=Object.create(sJ);return G.method=Y,G.url=Z,G.urlParams=$,G.hash=J,G.headers=Q,G.body=X,G}var i1=R("GET","",m0,H(),n,QZ),KY=(Y)=>(Z,$)=>p1(i1,{method:Y,url:Z,...$??void 0}),tJ=KY("GET"),eJ=KY("POST"),YQ=KY("PATCH"),ZQ=KY("PUT"),$Q=KY("DELETE");var JQ=KY("HEAD"),QQ=KY("OPTIONS"),XQ=KY("TRACE"),p1=O(2,(Y,Z)=>{let $=Y;if(Z.method)$=r6($,Z.method);if(Z.url)$=EZ($,Z.url);if(Z.headers)$=p0($,Z.headers);if(Z.urlParams)$=e6($,Z.urlParams);if(Z.hash)$=Y7($,Z.hash);if(Z.body)$=$Y($,Z.body);if(Z.accept)$=n1($,Z.accept);if(Z.acceptJson)$=s6($);return $}),r6=O(2,(Y,Z)=>R(Z,Y.url,Y.urlParams,Y.hash,Y.headers,Y.body)),HZ=O(3,(Y,Z,$)=>R(Y.method,Y.url,Y.urlParams,Y.hash,HY(Y.headers,Z,$),Y.body)),p0=O(2,(Y,Z)=>R(Y.method,Y.url,Y.urlParams,Y.hash,b0(Y.headers,Z),Y.body)),GQ=O(3,(Y,Z,$)=>HZ(Y,"Authorization",`Basic ${btoa(`${i0(Z)}:${i0($)}`)}`)),KQ=O(2,(Y,Z)=>HZ(Y,"Authorization",`Bearer ${i0(Z)}`)),n1=O(2,(Y,Z)=>HZ(Y,"Accept",Z)),s6=n1("application/json"),EZ=O(2,(Y,Z)=>{if(typeof Z==="string")return R(Y.method,Z,Y.urlParams,Y.hash,Y.headers,Y.body);let $=new URL(Z.toString()),J=a($.searchParams),Q=l1($.hash===""?void 0:$.hash.slice(1));return $.search="",$.hash="",R(Y.method,$.toString(),J,Q,Y.headers,Y.body)}),a1=O(2,(Y,Z)=>{if(Z==="")return Y;return R(Y.method,t6(Z,Y.url),Y.urlParams,Y.hash,Y.headers,Y.body)}),VQ=O(2,(Y,Z)=>{if(Z==="")return Y;return R(Y.method,t6(Y.url,Z),Y.urlParams,Y.hash,Y.headers,Y.body)}),t6=(Y,Z)=>{let $=Y.endsWith("/"),J=Z.startsWith("/");return $&&J?Y+Z.slice(1):!$&&!J?Y+"/"+Z:Y+Z},zQ=O(2,(Y,Z)=>R(Y.method,Z(Y.url),Y.urlParams,Y.hash,Y.headers,Y.body)),_Q=O(3,(Y,Z,$)=>R(Y.method,Y.url,R6(Y.urlParams,Z,$),Y.hash,Y.headers,Y.body)),e6=O(2,(Y,Z)=>R(Y.method,Y.url,S6(Y.urlParams,Z),Y.hash,Y.headers,Y.body)),BQ=O(3,(Y,Z,$)=>R(Y.method,Y.url,g6(Y.urlParams,Z,$),Y.hash,Y.headers,Y.body)),OQ=O(2,(Y,Z)=>R(Y.method,Y.url,C6(Y.urlParams,Z),Y.hash,Y.headers,Y.body)),Y7=O(2,(Y,Z)=>R(Y.method,Y.url,Y.urlParams,b(Z),Y.headers,Y.body)),DQ=(Y)=>R(Y.method,Y.url,Y.urlParams,H(),Y.headers,Y.body),$Y=O(2,(Y,Z)=>{let $=Y.headers;if(Z._tag==="Empty"||Z._tag==="FormData")$=q0(q0($,"Content-Type"),"Content-length");else{if(Z.contentType)$=HY($,"content-type",Z.contentType);if(Z.contentLength!==void 0)$=HY($,"content-length",Z.contentLength.toString())}return R(Y.method,Y.url,Y.urlParams,Y.hash,$,Z)}),WQ=O((Y)=>KZ(Y[0]),(Y,Z,$)=>$Y(Y,lZ(Z,$))),AQ=O((Y)=>KZ(Y[0]),(Y,Z,$)=>$Y(Y,uY(Z,$))),UQ=O(2,(Y,Z)=>L(d0(Z),($)=>$Y(Y,$))),FQ=O(2,(Y,Z)=>$Y(Y,c0(Z))),NQ=(Y,Z)=>{let $=d1(Y,Z);return O(2,(J,Q)=>L($(Q),(X)=>$Y(J,X)))},LQ=O(2,(Y,Z)=>$Y(Y,d6(a(Z)))),MQ=O(2,(Y,Z)=>$Y(Y,u0(Z))),TQ=O(2,(Y,Z)=>$Y(Y,l6(Z))),wQ=O((Y)=>KZ(Y[0]),(Y,Z,$)=>$Y(Y,jY(Z,$?.contentType,$?.contentLength))),HQ=O((Y)=>KZ(Y[0]),(Y,Z,$)=>L(p6(Z,$),(J)=>$Y(Y,J)));function o1(Y){let Z=uZ(Y.url,Y.urlParams,XZ(Y.hash));if(o6(Z))return b(Z.success);return H()}var EQ=(Y)=>{let Z=Y.method.toUpperCase();return p1(i1,{method:Z,url:new URL(Y.url),headers:Y.headers,body:IQ(Y,Z)})},IQ=(Y,Z)=>{if(!TZ(Z)||Y.body===null)return QZ;return c1(Y.body,{contentType:Y.headers.get("content-type")??void 0,contentLength:PQ(Y.headers.get("content-length"))})},PQ=(Y)=>{if(Y===null)return;let Z=Number.parseInt(Y,10);return Number.isNaN(Z)?void 0:Z},Z7=(Y,Z)=>{let $=uZ(Y.url,Y.urlParams,XZ(Y.hash));if(iZ($))return h($.failure);let J={method:Y.method,headers:Y.headers};if(Z?.signal)J.signal=Z.signal;if(TZ(Y.method))switch(Y.body._tag){case"Empty":break;case"Raw":{if(J.body=Y.body.body,jQ(Y.body.body))J.duplex="half";break}case"Uint8Array":{J.body=Y.body.body;break}case"FormData":{J.body=Y.body.formData;break}case"Stream":{J.body=wZ(Y.body.stream,Z?.context??GZ()),J.duplex="half";break}}return a6({try:()=>new Request($.success,J),catch:(Q)=>new h0({cause:Q})})},jQ=(Y)=>typeof ReadableStream<"u"&&Y instanceof ReadableStream,vQ=(Y,Z)=>ZY(($)=>Z7(Y,{context:$,signal:Z?.signal}).asEffect());var e0={};kY(e0,{stream:()=>kQ,schemaNoBody:()=>yQ,schemaJson:()=>xQ,schemaHeaders:()=>N7,schemaBodyUrlParams:()=>oZ,schemaBodyJson:()=>s0,matchStatus:()=>mQ,fromWeb:()=>J5,filterStatusOk:()=>X5,filterStatus:()=>Q5,TypeId:()=>zZ});var r1="~effect/http/Cookies",SQ=(Y)=>q(Y,r1);var $7="~effect/http/Cookies/Cookie";var J7="~effect/http/Cookies/CookieError";class B7 extends n0{}class VZ extends P("CookieError"){static fromReason(Y,Z){return new VZ({reason:new B7({_tag:Y,cause:Z})})}[J7]=J7;get message(){return this.reason._tag}}var gQ={[r1]:r1,..._Y,toJSON(){return{_id:"effect/Cookies",cookies:K7(this.cookies,(Y)=>Y.toJSON())}},pipe(){return vY(this,arguments)}},t1=(Y)=>{let Z=Object.create(gQ);return Z.cookies=Y,Z},O7=(Y)=>{let Z={};for(let $ of Y)Z[$.name]=$;return t1(Z)},e1=(Y)=>{let Z=typeof Y==="string"?[Y]:Y,$=[];for(let J of Z){let Q=CQ(J.trim());if(Q)$.push(Q)}return O7($)};function CQ(Y){let Z=Y.split(";").map((K)=>K.trim()).filter((K)=>K!=="");if(Z.length===0)return;let $=Z[0].indexOf("=");if($===-1)return;let J=Z[0].slice(0,$);if(!nZ.test(J))return;let Q=Z[0].slice($+1),X=U7(Q);if(Z.length===1)return Object.assign(Object.create(s1),{name:J,value:X,valueEncoded:Q});let G={};for(let K=1;K<Z.length;K++){let z=Z[K],_=z.indexOf("="),B=_===-1?z:z.slice(0,_).trim(),V=_===-1?void 0:z.slice(_+1).trim();switch(B.toLowerCase()){case"domain":{if(V===void 0)break;let D=V.trim().replace(/^\./,"");if(D)G.domain=D;break}case"expires":{if(V===void 0)break;let D=new Date(V);if(!isNaN(D.getTime()))G.expires=D;break}case"max-age":{if(V===void 0)break;let D=parseInt(V,10);if(!isNaN(D))G.maxAge=IZ(D);break}case"path":{if(V===void 0)break;if(V[0]==="/")G.path=V;break}case"priority":{if(V===void 0)break;switch(V.toLowerCase()){case"low":G.priority="low";break;case"medium":G.priority="medium";break;case"high":G.priority="high";break}break}case"httponly":{G.httpOnly=!0;break}case"secure":{G.secure=!0;break}case"partitioned":{G.partitioned=!0;break}case"samesite":{if(V===void 0)break;switch(V.toLowerCase()){case"lax":G.sameSite="lax";break;case"strict":G.sameSite="strict";break;case"none":G.sameSite="none";break}break}}}return Object.assign(Object.create(s1),{name:J,value:X,valueEncoded:Q,options:Object.keys(G).length>0?G:void 0})}var a0=O7([]),o0=(Y)=>G7(Y.cookies),nZ=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,s1={[$7]:$7,..._Y,toJSON(){return{_id:"effect/Cookies/Cookie",name:this.name,value:this.value,options:this.options}}};function bQ(Y,Z,$){if(!nZ.test(Y))return h(VZ.fromReason("InvalidCookieName"));let J=encodeURIComponent(Z);if(J&&!nZ.test(J))return h(VZ.fromReason("InvalidCookieValue"));if($!==void 0){if($.domain!==void 0&&!nZ.test($.domain))return h(VZ.fromReason("InvalidCookieDomain"));if($.path!==void 0&&!nZ.test($.path))return h(VZ.fromReason("InvalidCookiePath"));if($.maxAge!==void 0&&!z7(aZ($.maxAge)))return h(VZ.fromReason("CookieInfinityMaxAge"))}return PY(Object.assign(Object.create(s1),{name:Y,value:Z,valueEncoded:J,options:$}))}var Y5=O(2,(Y,Z)=>t1({...Y.cookies,...Z.cookies}));var D7=O((Y)=>SQ(Y[0]),(Y,Z,$,J)=>X7(bQ(Z,$,J),(Q)=>t1(V7(Y.cookies,Z,Q))));function qQ(Y){let Z=Y.name+"="+Y.valueEncoded;if(Y.options===void 0)return Z;let $=Y.options;if($.maxAge!==void 0){let J=_7(aZ($.maxAge));Z+="; Max-Age="+Math.trunc(J)}if($.domain!==void 0)Z+="; Domain="+$.domain;if($.path!==void 0)Z+="; Path="+$.path;if($.priority!==void 0)switch($.priority){case"low":Z+="; Priority=Low";break;case"medium":Z+="; Priority=Medium";break;case"high":Z+="; Priority=High";break}if($.expires!==void 0)Z+="; Expires="+$.expires.toUTCString();if($.httpOnly)Z+="; HttpOnly";if($.secure)Z+="; Secure";if($.partitioned)Z+="; Partitioned";if($.sameSite!==void 0)switch($.sameSite){case"lax":Z+="; SameSite=Lax";break;case"strict":Z+="; SameSite=Strict";break;case"none":Z+="; SameSite=None";break}return Z}var W7=(Y)=>Object.values(Y.cookies).map((Z)=>`${Z.name}=${Z.valueEncoded}`).join("; ");var A7=(Y)=>Object.values(Y.cookies).map(qQ);function Z5(Y){let Z={},$=Y.length,J=0,Q=0;while(!0){if(Q===$)break;if(Q=Y.indexOf(";",J),Q===-1)Q=$;let X=Y.indexOf("=",J);if(X===-1)break;if(X>Q){J=Q+1;continue}let G=Y.substring(J,X++).trim();if(Z[G]===void 0){let K=Y.charCodeAt(X)===34?Y.substring(X+1,Q-1).trim():Y.substring(X,Q).trim();Z[G]=K.indexOf("%")!==-1?U7(K):K}J=Q+1}return Z}var U7=(Y)=>{try{return decodeURIComponent(Y)}catch(Z){return Y}};var c="~effect/http/HttpIncomingMessage";var s0=(Y,Z)=>{let $=iY(LZ(Y).annotate({options:Z}));return(J)=>U(J.json,$)},oZ=(Y,Z)=>{let $=q6.pipe(cY(Y),F7({options:Z}),iY);return(J)=>U(J.urlParamsBody,$)},N7=(Y,Z)=>{let $=f(Y);return(J)=>$(J.headers,Z)},rZ=j("effect/http/HttpIncomingMessage/MaxBodySize",{defaultValue:()=>{return}}),sZ=(Y,Z)=>{let $=Y.headers["content-type"]??"",J;if($.includes("application/json"))try{J=o(Y.json)}catch(X){}else if($.includes("text/")||$.includes("urlencoded"))try{J=o(Y.text)}catch(X){}let Q={...Z,headers:fY(Y.headers),remoteAddress:Y.remoteAddress};if(J!==void 0)Q.body=J;return Q};var zZ="~effect/http/HttpClientResponse",J5=(Y,Z)=>new L7(Y,Z),xQ=(Y,Z)=>{let $=iY(LZ(Y).annotate({options:Z}));return(J)=>U(J.json,(Q)=>$({status:J.status,headers:J.headers,body:Q}))},yQ=(Y,Z)=>{let $=iY(Y.annotate({options:Z}));return(J)=>$({status:J.status,headers:J.headers})},kQ=(Y)=>$5(L(Y,(Z)=>Z.stream)),mQ=O(2,(Y,Z)=>{let $=Y.status;if(Z[$])return Z[$](Y);else if($>=200&&$<300&&Z["2xx"])return Z["2xx"](Y);else if($>=300&&$<400&&Z["3xx"])return Z["3xx"](Y);else if($>=400&&$<500&&Z["4xx"])return Z["4xx"](Y);else if($>=500&&$<600&&Z["5xx"])return Z["5xx"](Y);return Z.orElse(Y)}),Q5=O(2,(Y,Z)=>_Z(()=>Z(Y.status)?F(Y):g(new x({reason:new kZ({response:Y,request:Y.request,description:"invalid status code"})})))),X5=(Y)=>Y.status>=200&&Y.status<300?F(Y):g(new x({reason:new kZ({response:Y,request:Y.request,description:"non 2xx status code"})}));class L7 extends RY{[c];[zZ];request;source;constructor(Y,Z){super();this.request=Y,this.source=Z,this[c]=c,this[zZ]=zZ}toJSON(){return sZ(this,{_id:"HttpClientResponse",request:this.request.toJSON(),status:this.status})}get status(){return this.source.status}get headers(){return C(this.source.headers)}cachedCookies;get cookies(){if(this.cachedCookies)return this.cachedCookies;return this.cachedCookies=e1(this.source.headers.getSetCookie())}get remoteAddress(){return H()}get stream(){return this.source.body?SY({evaluate:()=>this.source.body,onError:(Y)=>new x({reason:new TY({request:this.request,response:this,cause:Y})})}):tZ(new x({reason:new R0({request:this.request,response:this,description:"can not create stream from empty body"})}))}get json(){return U(this.text,(Y)=>GY({try:()=>Y===""?null:JSON.parse(Y),catch:(Z)=>new x({reason:new TY({request:this.request,response:this,cause:Z})})}))}textBody;get text(){return this.textBody??=d({try:()=>this.source.text(),catch:(Y)=>new x({reason:new TY({request:this.request,response:this,cause:Y})})}).pipe(OY,o)}get urlParamsBody(){return U(this.text,(Y)=>GY({try:()=>a(new URLSearchParams(Y)),catch:(Z)=>new x({reason:new TY({request:this.request,response:this,cause:Z})})}))}formDataBody;get formData(){return this.formDataBody??=d({try:()=>this.source.formData(),catch:(Y)=>new x({reason:new TY({request:this.request,response:this,cause:Y})})}).pipe(OY,o)}arrayBufferBody;get arrayBuffer(){return this.arrayBufferBody??=d({try:()=>this.source.arrayBuffer(),catch:(Y)=>new x({reason:new TY({request:this.request,response:this,cause:Y})})}).pipe(OY,o)}pipe(){return vY(this,arguments)}}var G1={};kY(G1,{withScope:()=>HX,withRateLimiter:()=>OX,withCookiesRef:()=>wX,transformResponse:()=>s,transform:()=>A5,tapRequest:()=>TX,tapError:()=>MX,tap:()=>LX,retryTransient:()=>BX,retry:()=>_X,put:()=>rQ,post:()=>aQ,patch:()=>oQ,options:()=>tQ,mapRequestInputEffect:()=>zX,mapRequestInput:()=>VX,mapRequestEffect:()=>KX,mapRequest:()=>F5,makeWith:()=>VY,make:()=>U5,layerMergedContext:()=>N5,isHttpClient:()=>r7,head:()=>nQ,get:()=>pQ,followRedirects:()=>EX,filterStatusOk:()=>XX,filterStatus:()=>QX,filterOrFail:()=>JX,filterOrElse:()=>$X,execute:()=>iQ,del:()=>sQ,catchTags:()=>ZX,catchTag:()=>YX,catch:()=>eQ,TracerPropagationEnabled:()=>e7,TracerDisabledWhen:()=>t7,SpanNameGenerator:()=>Y8,HttpClient:()=>vZ});var T7=(Y)=>wY({b3:`${Y.traceId}-${Y.spanId}-${Y.sampled?"1":"0"}${BY(Y.parent,{onNone:()=>"",onSome:(Z)=>`-${Z.spanId}`})}`,traceparent:`00-${Y.traceId}-${Y.spanId}-${Y.sampled?"01":"00"}`}),w7=(Y)=>{let Z=uQ(Y);if(r(Z))return Z;if(Z=hQ(Y),r(Z))return Z;return fQ(Y)},hQ=(Y)=>{if(!("b3"in Y))return H();let Z=Y.b3.split("-");if(Z.length<2)return H();return b(Y1({traceId:Z[0],spanId:Z[1],sampled:Z[2]?Z[2]==="1":!0}))},fQ=(Y)=>{if(!Y["x-b3-traceid"]||!Y["x-b3-spanid"])return H();return b(Y1({traceId:Y["x-b3-traceid"],spanId:Y["x-b3-spanid"],sampled:Y["x-b3-sampled"]?Y["x-b3-sampled"]==="1":!0}))},cQ=/^[0-9a-f]{32}$/i,dQ=/^[0-9a-f]{16}$/i,uQ=(Y)=>{if(!Y.traceparent)return H();let Z=Y.traceparent.split("-");if(Z.length!==4)return H();let[$,J,Q,X]=Z;switch($){case"00":{if(cQ.test(J)===!1||dQ.test(Q)===!1)return H();return b(Y1({traceId:J,spanId:Q,sampled:(parseInt(X,16)&1)===1}))}default:return H()}};var V5="~effect/http/HttpClient",r7=(Y)=>q(Y,V5),vZ=S("effect/HttpClient"),aY=(Y)=>(...Z)=>U(vZ.asEffect(),($)=>$[Y](...Z)),iQ=aY("execute"),pQ=aY("get"),nQ=aY("head"),aQ=aY("post"),oQ=aY("patch"),rQ=aY("put"),sQ=aY("del"),tQ=aY("options"),A5=O(2,(Y,Z)=>VY(U(($)=>Z(Y.postprocess(F($)),$)),Y.preprocess)),s=O(2,(Y,Z)=>VY(($)=>Z(Y.postprocess($)),Y.preprocess)),eQ=O(2,(Y,Z)=>s(Y,b7(Z)));var YX=O(3,(Y,Z,$)=>s(Y,X1(Z,$))),ZX=O(2,(Y,Z)=>s(Y,q7(Z))),$X=O(3,(Y,Z,$)=>s(Y,m7(Z,$))),JX=O(3,(Y,Z,$)=>s(Y,h7(Z,$))),QX=O(2,(Y,Z)=>s(Y,U(Q5(Z)))),XX=s(U(X5)),VY=(Y,Z)=>{let $=Object.create(GX);return $.preprocess=Z,$.postprocess=Y,$.execute=function(J){return Y(Z(J))},$},GX={[V5]:V5,pipe(){return vY(this,arguments)},..._Y,toJSON(){return{_id:"effect/HttpClient"}},...Object.fromEntries(n6.map(([Y,Z])=>[Z,function($,J){return this.execute(KY(Y)($,J))}]))},U5=(Y)=>VY((Z)=>U(Z,($)=>u((J)=>{let Q=Z8.get($),X=Q??new AbortController,G=uZ($.url,$.urlParams,XZ($.hash));if(iZ(G))return g(new x({reason:new v0({request:$,cause:G.failure})}));let K=G.success;if(J.getRef(R7)||J.getRef(t7)($)){let _=Y($,K,X.signal,J);if(Q)return _;return K5((B)=>jZ(B(_),{onSuccess(V){return Z1.register(V,X),F(new z5(V,X))},onFailure(V){if(G5(V))X.abort();return eZ(V)}}))}return l7(J.getRef(Y8)($),{kind:"client"},(_)=>{if(_.attribute("http.request.method",$.method),_.attribute("server.address",K.origin),K.port!=="")_.attribute("server.port",+K.port);_.attribute("url.full",K.toString()),_.attribute("url.path",K.pathname),_.attribute("url.scheme",K.protocol.slice(0,-1));let B=K.search.slice(1);if(B!=="")_.attribute("url.query",B);let V=J.getRef(cZ),D=YZ($.headers,V);for(let A in D)_.attribute(`http.request.header.${A}`,String(D[A]));return $=J.getRef(e7)?p0($,T7(_)):$,K5((A)=>A(Y($,K,X.signal,J)).pipe(i7(_,{captureStackTrace:!1}),jZ({onSuccess:(W)=>{_.attribute("http.response.status_code",W.status);let N=YZ(W.headers,V);for(let T in N)_.attribute(`http.response.header.${T}`,String(N[T]));if(Q)return F(W);return Z1.register(W,X),F(new z5(W,X))},onFailure(W){if(!Q&&G5(W))X.abort();return eZ(W)}})))})})),F),F5=O(2,(Y,Z)=>VY(Y.postprocess,($)=>L(Y.preprocess($),Z))),KX=O(2,(Y,Z)=>VY(Y.postprocess,($)=>U(Y.preprocess($),Z))),VX=O(2,(Y,Z)=>VY(Y.postprocess,($)=>Y.preprocess(Z($)))),zX=O(2,(Y,Z)=>VY(Y.postprocess,($)=>U(Z($),Y.preprocess))),_X=O(2,(Y,Z)=>s(Y,D5(Z))),BX=O(2,(Y,Z)=>{let $=g7(Z),J=$?"errors-and-responses":Z.retryOn??"errors-and-responses",Q=$?Z:Z.schedule,X=Q&&C7(Q),G=$?void 0:Z.times;return s(Y,_5(J==="errors-only"?BZ:u7({schedule:X,times:G,while:$8}),J==="response-only"?BZ:D5({while:$||Z.while===void 0?E7:P7(E7,Z.while),schedule:Q,times:G})))}),OX=O(2,(Y,Z)=>{let $={initial:!0,limit:Z.limit,window:Y0(aZ(Z.window),gY(1))},J=new Map,Q=Z.key,X=typeof Q==="function"?Q:DY(Q),G=Z.tokens,K=typeof G==="function"?G:DY(G??1),z=(B)=>{let V=J.get(B);if(V!==void 0)return V;return J.set(B,$),$},_=Z.disableResponseInspection?void 0:(B,V,D,A)=>{let W=z(V),N=DX(W,B,D,A);if(N.limit!==W.limit||!B5(N.window,W.window))J.set(V,N)};return A5(Y,function B(V,D){let W=nY().getRef(J1),N=X(D),T=Math.max(K(D),1),E=z(N);function YY(I){if(Z.disableResponseInspection)return B(V,D);let p=s7(W,PZ(I.headers,"retry-after"));return p?U(k7(p),()=>B(V,D)):B(V,D)}return U(Z.limiter.consume({algorithm:Z.algorithm,onExceeded:"delay",key:N,limit:E.limit,window:E.window,tokens:T}),({delay:I})=>{let p=f7(V,{onSuccess(w){if(_?.(W,N,w.headers,T),w.status!==429)return F(w);return YY(w)},onFailure(w){if(PX(w))return _?.(W,N,w.reason.response.headers,T),YY(w.reason.response);return g(w)}});return v7(I)?p:y7(p,I)})})}),DX=(Y,Z,$,J)=>{let Q=WX(Y,$,J)??Y.limit,X=UX(Z,$)??Y.window;if(Q===Y.limit&&B5(X,Y.window))return Y;return{limit:Q,window:X,initial:!1}},WX=(Y,Z,$)=>{let J=PZ(Z,"ratelimit-limit","x-ratelimit-limit"),Q=J0(J);if(Q!==void 0&&Q>0)return Q;let X=AX(Z);if(X===void 0)return;return Y.initial?X+$:Math.max(X+$,Y.limit)},AX=(Y)=>{let Z=PZ(Y,"ratelimit-remaining","x-ratelimit-remaining"),$=J0(Z);return $!==void 0&&$>=0?$:void 0},UX=(Y,Z)=>{let $=s7(Y,PZ(Z,"retry-after"));if($!==void 0)return $;let J=FX(PZ(Z,"ratelimit-reset-after","x-ratelimit-reset-after"));if(J!==void 0)return J;return NX(Y,PZ(Z,"ratelimit-reset","x-ratelimit-reset"))},s7=(Y,Z)=>{if(Z===void 0)return;let $=J0(Z);if($!==void 0)return Y0(IZ($),gY(1));let J=Date.parse(Z);if(Number.isNaN(J))return;let Q=J-Y.currentTimeMillisUnsafe();if(Q<=0)return gY(1);return gY(Q)},FX=(Y)=>{let Z=J0(Y);if(Z===void 0||Z<=0)return;return Y0(IZ(Z),gY(1))},NX=(Y,Z)=>{let $=J0(Z);if($===void 0||$<=0)return;let J=Y.currentTimeMillisUnsafe();if($>1000000000000)return gY(Math.max($-J,1));if($>1e9)return gY(Math.max($*1000-J,1));return Y0(IZ($),gY(1))},J0=(Y)=>{if(Y===void 0)return;let Z=/-?\d+(?:\.\d+)?/.exec(Y);if(Z===null)return;let $=Number(Z[0]);return Number.isFinite($)?$:void 0},PZ=(Y,...Z)=>{for(let $=0;$<Z.length;$++){let J=Y[Z[$]];if(J!==void 0)return J}return},LX=O(2,(Y,Z)=>s(Y,Q1(Z))),MX=O(2,(Y,Z)=>s(Y,x7(Z))),TX=O(2,(Y,Z)=>VY(Y.postprocess,($)=>Q1(Y.preprocess($),Z))),wX=O(2,(Y,Z)=>VY(($)=>Q1(Y.postprocess($),(J)=>o7(Z,(Q)=>Y5(Q,J.cookies))),($)=>U(Y.preprocess($),(J)=>L(a7(Z),(Q)=>o0(Q)?J:HZ(J,"cookie",W7(Q)))))),HX=(Y)=>A5(Y,(Z,$)=>{let J=new AbortController;return Z8.set($,J),$0(c7(()=>WY(()=>J.abort())),Z)}),EX=O((Y)=>r7(Y[0]),(Y,Z)=>VY(($)=>{let J=(Q,X)=>U(Y.postprocess(F(Q)),(G)=>G.status>=300&&G.status<400&&G.headers.location&&X<(Z??10)?J(EZ(Q,new URL(G.headers.location,G.request.url)),X+1):F(G));return U($,(Q)=>J(Q,0))},Y.preprocess)),t7=j("effect/http/HttpClient/TracerDisabledWhen",{defaultValue:()=>$1}),e7=j("effect/HttpClient/TracerPropagationEnabled",{defaultValue:I7}),Y8=j("effect/http/HttpClient/SpanNameGenerator",{defaultValue:()=>(Y)=>`http.client ${Y.method}`}),N5=(Y)=>pY(vZ)(ZY((Z)=>L(Y,($)=>s($,W5((J)=>j7(Z,J)))))),Z1=(()=>{if("FinalizationRegistry"in globalThis&&globalThis.FinalizationRegistry){let Z=new FinalizationRegistry(($)=>{$.abort()});return{register($,J){Z.register($,J,$)},unregister($){Z.unregister($)}}}let Y=new Map;return{register(Z,$){Y.set(Z,setTimeout(()=>$.abort(),5000))},unregister(Z){let $=Y.get(Z);if($===void 0)return;clearTimeout($),Y.delete(Z)}}})(),Z8=new WeakMap;class z5{original;controller;constructor(Y,Z){this.original=Y,this.controller=Z}[zZ]=zZ;[c]=c;applyInterrupt(Y){return _Z(()=>{return Z1.unregister(this.original),d7(Y,()=>WY(()=>{this.controller.abort()}))})}get request(){return this.original.request}get status(){return this.original.status}get headers(){return this.original.headers}get cookies(){return this.original.cookies}get remoteAddress(){return this.original.remoteAddress}get formData(){return this.applyInterrupt(this.original.formData)}get text(){return this.applyInterrupt(this.original.text)}get json(){return this.applyInterrupt(this.original.json)}get urlParamsBody(){return this.applyInterrupt(this.original.urlParamsBody)}get arrayBuffer(){return this.applyInterrupt(this.original.arrayBuffer)}get stream(){return p7(()=>{return Z1.unregister(this.original),n7(this.original.stream,WY(()=>{this.controller.abort()}))})}toJSON(){return this.original.toJSON()}[hY](){return this.original[hY]()}pipe(){return vY(this,arguments)}}var E7=(Y)=>S7(Y)||IX(Y),IX=(Y)=>P0(Y)&&(Y.reason._tag==="TransportError"||Y.reason._tag==="StatusCodeError"&&$8(Y.reason.response)),PX=(Y)=>P0(Y)&&Y.reason._tag==="StatusCodeError"&&Y.reason.response.status===429,$8=(Y)=>Y.status===408||Y.status===429||Y.status===500||Y.status===502||Y.status===503||Y.status===504;var X8={};kY(X8,{layer:()=>vX,RequestInit:()=>L5,Fetch:()=>Q8});var Q8=j("effect/http/FetchHttpClient/Fetch",{defaultValue:()=>globalThis.fetch});class L5 extends S()("effect/http/FetchHttpClient/RequestInit"){}var jX=U5((Y,Z,$,J)=>{let Q=J.getRef(Q8),X=J.context.mapUnsafe.get(L5.key)??{},G=X.headers?fZ(C(X.headers),Y.headers):Y.headers,K=(z)=>L(d({try:()=>Q(Z,{...X,method:Y.method,headers:G,body:z,duplex:Y.body._tag==="Stream"?"half":void 0,signal:$}),catch:(_)=>new x({reason:new j0({request:Y,cause:_})})}),(_)=>J5(Y,_));switch(Y.body._tag){case"Raw":case"Uint8Array":return K(Y.body.body);case"FormData":return K(Y.body.formData);case"Stream":return U(J8(Y.body.stream),K)}return K(void 0)}),vX=N5(F(jX));var qJ={};kY(qJ,{use:()=>SJ,toWebHandler:()=>H2,toHttpEffect:()=>A2,serve:()=>w2,schemaPathParams:()=>O2,schemaParams:()=>B2,schemaNoBody:()=>_2,schemaJson:()=>z2,route:()=>gJ,provideRequest:()=>T2,prefixRoute:()=>CJ,prefixPath:()=>T0,params:()=>RJ,middleware:()=>R1,make:()=>vJ,layer:()=>xZ,disableLogger:()=>M2,cors:()=>L2,addAll:()=>W2,add:()=>D2,RouterConfig:()=>v1,RouteContext:()=>WZ,HttpRouter:()=>LY});var G8=/\+/g,K8=function(){};K8.prototype=Object.create(null);function V8(Y){let Z=new K8;if(typeof Y!=="string")return Z;let $=Y.length,J="",Q="",X=-1,G=-1,K=!1,z=!1,_=!1,B=!1,V=!1,D=0;for(let A=0;A<$+1;A++)if(D=A!==$?Y.charCodeAt(A):38,D===38){if(V=G>X,!V)G=A;if(J=Y.slice(X+1,G),V||J.length>0){if(_)J=J.replace(G8," ");if(K)try{J=decodeURIComponent(J)||J}catch{}if(V){if(Q=Y.slice(G+1,A),B)Q=Q.replace(G8," ");if(z)try{Q=decodeURIComponent(Q)||Q}catch{}}let W=Z[J];if(W===void 0)Z[J]=Q;else if(W.pop)W.push(Q);else Z[J]=[W,Q]}Q="",X=A,G=A,K=!1,z=!1,_=!1,B=!1}else if(D===61)if(G<=X)G=A;else z=!0;else if(D===43)if(G>X)B=!0;else _=!0;else if(D===37)if(G>X)z=!0;else K=!0;return Z}var SX=/^https?:\/\/.*?\//,M5=/(\/:[^/()]*?)\?(\/?)/,O8=(Y={})=>new D8(Y);class D8{constructor(Y={}){this.options={ignoreTrailingSlash:!0,ignoreDuplicateSlashes:!0,caseSensitive:!1,maxParamLength:100,...Y}}options;routes=[];trees={};on(Y,Z,$){let J=Z.match(M5);if(J&&J.index!==void 0){gX(Z.length===J.index+J[0].length,"Optional Parameter needs to be the last parameter of the path");let X=Z.replace(M5,"$1$2"),G=Z.replace(M5,"$2");this.on(Y,X,$),this.on(Y,G,$);return}if(this.options.ignoreDuplicateSlashes)Z=z8(Z);if(this.options.ignoreTrailingSlash)Z=_8(Z);let Q=typeof Y==="string"?[Y]:Y;for(let X of Q)this._on(X,Z,$)}all(Y,Z){this.on(kX,Y,Z)}_on(Y,Z,$){if(this.trees[Y]===void 0)this.trees[Y]=new Q0("/");let J=Z;if(J==="*"&&this.trees[Y].prefix.length!==0){let z=this.trees[Y];this.trees[Y]=new Q0(""),this.trees[Y].staticChildren["/"]=z}let Q=this.trees[Y].prefix.length,X=this.trees[Y],G=[];for(let z=0;z<=J.length;z++){if(J.charCodeAt(z)===58&&J.charCodeAt(z+1)===58){z++;continue}let _=J.charCodeAt(z)===58&&J.charCodeAt(z+1)!==58,B=J.charCodeAt(z)===42;if(_||B||z===J.length&&z!==Q){let V=J.slice(Q,z);if(!this.options.caseSensitive)V=V.toLowerCase();V=V.split("::").join(":"),V=V.split("%").join("%25"),X=X.createStaticChild(V)}if(_){let V=!1,D=[],A=z+1;for(let W=A;;W++){let N=J.charCodeAt(W),T=N===40,E=N===45||N===46,YY=N===47||W===J.length;if(T||E||YY){let I=J.slice(A,W);if(G.push(I),V=V||T||E,T){let yY=bX(J,W),w0=J.slice(W,yY+1);D.push(qX(w0)),W=yY+1}else D.push("(.*?)");let p=W;for(;W<J.length;W++){let yY=J.charCodeAt(W);if(yY===47)break;if(yY===58)if(J.charCodeAt(W+1)===58)W++;else break}let w=J.slice(p,W);if(w)w=w.split("::").join(":"),w=w.split("%").join("%25"),D.push(xX(w));if(A=W+1,YY||J.charCodeAt(W)===47||W===J.length){let yY=V?"()"+w:w,w0=J.slice(z,W);J=J.slice(0,z+1)+yY+J.slice(W),z+=yY.length;let xJ=V?new RegExp("^"+D.join("")+"$"):void 0;X=X.createParametricChild(xJ,w,w0),Q=z+1;break}}}}else if(B){if(G.push("*"),X=X.createWildcardChild(),Q=z+1,z!==J.length-1)throw Error("Wildcard must be the last character in the route")}}if(!this.options.caseSensitive)J=J.toLowerCase();if(J==="*")J="/*";for(let z of this.routes)if(z.method===Y&&z.pattern===J)throw Error(`Method '${Y}' already declared for route '${J}'`);let K={method:Y,path:Z,pattern:J,params:G,handler:$};this.routes.push(K),X.addRoute(K)}has(Y,Z){let $=this.trees[Y];if($===void 0)return!1;let J=$.getStaticChild(Z);if(J===void 0)return!1;return J.isLeafNode}find(Y,Z){let $=this.trees[Y];if($===void 0)return;if(Z.charCodeAt(0)!==47)Z=Z.replace(SX,"/");if(this.options.ignoreDuplicateSlashes)Z=z8(Z);let J,Q,X;try{J=yX(Z),Z=J.path,Q=J.querystring,X=J.shouldDecodeParam}catch(D){return}if(this.options.ignoreTrailingSlash)Z=_8(Z);let G=Z;if(this.options.caseSensitive===!1)Z=Z.toLowerCase();let K=this.options.maxParamLength,z=$.prefix.length,_=[],B=Z.length,V=[];while(!0){if(z===B&&$.isLeafNode){let A=$.handlerStorage?.find();if(A!==void 0)return{handler:A.handler,params:A.createParams(_),searchParams:V8(Q)}}let D=$.getNextNode(Z,z,V,_.length);if(D===void 0){if(V.length===0)return;let A=V.pop();z=A.brotherPathIndex,_.splice(A.paramsCount),D=A.brotherNode}if($=D,$._tag==="StaticNode"){z+=$.prefix.length;continue}if($._tag==="WildcardNode"){let A=G.slice(z);if(X)A=B8(A);_.push(A),z=B;continue}if($._tag==="ParametricNode"){let A=G.indexOf("/",z);if(A===-1)A=B;let W=G.slice(z,A);if(X)W=B8(W);if($.regex!==void 0){let N=$.regex.exec(W);if(N===null)continue;for(let T=1;T<N.length;T++){let E=N[T];if(E.length>K)return;_.push(E)}}else{if(W.length>K)return;_.push(W)}z=A}}}}class W8{handlers=[];unconstrainedHandler;find(){return this.unconstrainedHandler}add(Y){let Z={params:Y.params,handler:Y.handler,createParams:CX(Y.params)};this.handlers.push(Z),this.unconstrainedHandler=this.handlers[0]}}class T5{isLeafNode=!1;routes;handlerStorage;addRoute(Y){if(this.routes===void 0)this.routes=[Y];else this.routes.push(Y);if(this.handlerStorage===void 0)this.handlerStorage=new W8;this.isLeafNode=!0,this.handlerStorage.add(Y)}}class w5 extends T5{staticChildren={};findStaticMatchingChild(Y,Z){let $=this.staticChildren[Y.charAt(Z)];if($===void 0||!$.matchPrefix(Y,Z))return;return $}getStaticChild(Y,Z=0){if(Y.length===Z)return this;let $=this.findStaticMatchingChild(Y,Z);if($===void 0)return;return $.getStaticChild(Y,Z+$.prefix.length)}createStaticChild(Y){if(Y.length===0)return this;let Z=this.staticChildren[Y.charAt(0)];if(Z){let J=1;for(;J<Z.prefix.length;J++)if(Y.charCodeAt(J)!==Z.prefix.charCodeAt(J)){Z=Z.split(this,J);break}return Z.createStaticChild(Y.slice(J))}let $=Y.charAt(0);return this.staticChildren[$]=new Q0(Y),this.staticChildren[$]}}class Q0 extends w5{_tag="StaticNode";constructor(Y){super();this.setPrefix(Y)}prefix;matchPrefix;parametricChildren=[];wildcardChild;setPrefix(Y){if(this.prefix=Y,Y.length===1)this.matchPrefix=(Z,$)=>!0;else{let Z=Y.length;this.matchPrefix=function($,J){for(let Q=1;Q<Z;Q++)if($.charCodeAt(J+Q)!==this.prefix.charCodeAt(Q))return!1;return!0}}}getParametricChild(Y){if(Y===void 0)return this.parametricChildren.find(($)=>$.isRegex===!1);let Z=Y.source;return this.parametricChildren.find(($)=>{if($.regex===void 0)return!1;return $.regex.source===Z})}createParametricChild(Y,Z,$){let J=this.getParametricChild(Y);if(J!==void 0)return J.nodePaths.add($),J;return J=new A8(Y,Z,$),this.parametricChildren.push(J),this.parametricChildren.sort((Q,X)=>{if(!Q.isRegex)return 1;if(!X.isRegex)return-1;if(Q.staticSuffix===void 0)return 1;if(X.staticSuffix===void 0)return-1;if(X.staticSuffix.endsWith(Q.staticSuffix))return 1;if(Q.staticSuffix.endsWith(X.staticSuffix))return-1;return 0}),J}createWildcardChild(){if(this.wildcardChild===void 0)this.wildcardChild=new U8;return this.wildcardChild}split(Y,Z){let $=this.prefix.slice(0,Z),J=this.prefix.slice(Z);this.setPrefix(J);let Q=new Q0($);return Q.staticChildren[J.charAt(0)]=this,Y.staticChildren[$.charAt(0)]=Q,Q}getNextNode(Y,Z,$,J){let Q=this.findStaticMatchingChild(Y,Z),X=0;if(Q===void 0){if(this.parametricChildren.length===0)return this.wildcardChild;Q=this.parametricChildren[0],X=1}if(this.wildcardChild!==void 0)$.push({paramsCount:J,brotherPathIndex:Z,brotherNode:this.wildcardChild});for(let G=this.parametricChildren.length-1;G>=X;G--)$.push({paramsCount:J,brotherPathIndex:Z,brotherNode:this.parametricChildren[G]});return Q}}class A8 extends w5{regex;staticSuffix;_tag="ParametricNode";constructor(Y,Z,$){super();this.regex=Y,this.staticSuffix=Z,this.isRegex=!!Y,this.nodePaths=new Set([$])}isRegex;nodePaths;getNextNode(Y,Z){return this.findStaticMatchingChild(Y,Z)}}class U8 extends T5{_tag="WildcardNode";getNextNode(Y,Z,$,J){return}}var gX=(Y,Z)=>{if(!Y)throw Error(Z)};function z8(Y){return Y.replace(/\/\/+/g,"/")}function _8(Y){if(Y.length>1&&Y.charCodeAt(Y.length-1)===47)return Y.slice(0,-1);return Y}function CX(Y){let Z=Y.length;return function($){let J={};for(let Q=0;Q<Z;Q++)J[Y[Q]]=$[Q];return J}}function bX(Y,Z){let $=1;while(Z<Y.length){if(Z++,Y[Z]==="\\"){Z++;continue}if(Y[Z]===")")$--;else if(Y[Z]==="(")$++;if(!$)return Z}throw TypeError('Invalid regexp expression in "'+Y+'"')}function qX(Y){if(Y.charCodeAt(1)===94)Y=Y.slice(0,1)+Y.slice(2);if(Y.charCodeAt(Y.length-2)===36)Y=Y.slice(0,Y.length-2)+Y.slice(Y.length-1);return Y}function xX(Y){return Y.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function F8(Y,Z){if(Y===50){if(Z===53)return"%";if(Z===51)return"#";if(Z===52)return"$";if(Z===54)return"&";if(Z===66)return"+";if(Z===98)return"+";if(Z===67)return",";if(Z===99)return",";if(Z===70)return"/";if(Z===102)return"/";return}if(Y===51){if(Z===65)return":";if(Z===97)return":";if(Z===66)return";";if(Z===98)return";";if(Z===68)return"=";if(Z===100)return"=";if(Z===70)return"?";if(Z===102)return"?";return}if(Y===52&&Z===48)return"@";return}function yX(Y){let Z=!1,$=!1,J="";for(let X=1;X<Y.length;X++){let G=Y.charCodeAt(X);if(G===37){let K=Y.charCodeAt(X+1),z=Y.charCodeAt(X+2);if(F8(K,z)===void 0)Z=!0;else{if($=!0,K===50&&z===53)Z=!0,Y=Y.slice(0,X+1)+"25"+Y.slice(X+1),X+=2;X+=2}}else if(G===63||G===59||G===35){J=Y.slice(X+1),Y=Y.slice(0,X);break}}return{path:Z?decodeURI(Y):Y,querystring:J,shouldDecodeParam:$}}function B8(Y){let Z=Y.indexOf("%");if(Z===-1)return Y;let $="",J=Z;for(let Q=Z;Q<Y.length;Q++)if(Y.charCodeAt(Q)===37){let X=Y.charCodeAt(Q+1),G=Y.charCodeAt(Q+2),K=F8(X,G);$+=Y.slice(J,Q)+K,J=Q+3}return Y.slice(0,Z)+$+Y.slice(J)}var kX=["ACL","BIND","CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LINK","LOCK","M-SEARCH","MERGE","MKACTIVITY","MKCALENDAR","MKCOL","MOVE","NOTIFY","OPTIONS","PATCH","POST","PROPFIND","PROPPATCH","PURGE","PUT","REBIND","REPORT","SEARCH","SOURCE","SUBSCRIBE","TRACE","UNBIND","UNLINK","UNLOCK","UNSUBSCRIBE"];var N8=O8;var H5="~effect/http/HttpServerResponse",AY=(Y)=>q(Y,H5),t=(Y)=>UY({status:Y?.status??204,statusText:Y?.statusText,headers:Y?.headers?C(Y.headers):void 0,cookies:Y?.cookies});var N3=(Y,Z)=>{let $=Z?.headers?C(Z.headers):n;return UY({status:Z?.status??200,statusText:Z?.statusText,headers:$,cookies:Z?.cookies??a0,body:lZ(Y,G0(Z,$))})},G0=(Y,Z)=>{if(Y?.contentType)return Y.contentType;else if(Y?.headers)return Z["content-type"]},L3=(Y,Z)=>{let $=Z?.headers?C(Z.headers):n;return UY({status:Z?.status??200,statusText:Z?.statusText,headers:$,cookies:Z?.cookies??a0,body:uY(Y,G0(Z,$))})};var M3=(Y,Z)=>{let $=Z?.headers?C(Z.headers):n;return UY({status:Z?.status??200,statusText:Z?.statusText,headers:$,cookies:Z?.cookies,body:c0(Y,G0(Z,$))})},T3=(Y,Z)=>{let $=Z?.headers?C(Z.headers):n;return UY({status:Z?.status??200,statusText:Z?.statusText,headers:$,cookies:Z?.cookies,body:uY(f0(a(Y)),G0(Z,$)??"application/x-www-form-urlencoded")})};var j5=(Y,Z)=>{let $=Z?.headers?C(Z.headers):n;return UY({status:Z?.status??200,statusText:Z?.statusText,headers:$,cookies:Z?.cookies,body:jY(Y,G0(Z,$),Z?.contentLength)})};var w3=O(3,(Y,Z,$)=>UY({...Y,headers:HY(Y.headers,Z,$)})),L8=O(2,(Y,Z)=>UY({...Y,headers:b0(Y.headers,Z)}));var H3=O((Y)=>AY(Y[0]),(Y,Z,$,J)=>L(D7(Y.cookies,Z,$,J).asEffect(),(Q)=>UY({...Y,cookies:Q})));var M8=O(2,(Y,Z)=>UY({...Y,body:Z}));var T8=(Y,Z)=>{let $=new globalThis.Headers(Y.headers);if(!o0(Y.cookies)){let Q=A7(Y.cookies);for(let X of Q)$.append("set-cookie",X)}if(Z?.withoutBody)return new Response(void 0,{status:Y.status,statusText:Y.statusText,headers:$});let J=Y.body;switch(J._tag){case"Empty":return new Response(void 0,{status:Y.status,statusText:Y.statusText,headers:$});case"Uint8Array":case"Raw":{if(J.body instanceof Response){for(let[Q,X]of $)J.body.headers.set(Q,X);return J.body}return new Response(J.body,{status:Y.status,statusText:Y.statusText,headers:$})}case"FormData":return new Response(J.formData,{status:Y.status,statusText:Y.statusText,headers:$});case"Stream":return new Response(wZ(J.stream,Z?.context??GZ()),{status:Y.status,statusText:Y.statusText,headers:$})}};var fX={...x0,[H5]:H5,[RZ]:!0,toJSON(){return{_id:"HttpServerResponse",status:this.status,statusText:this.statusText,headers:fY(this.headers),cookies:this.cookies.toJSON(),body:this.body.toJSON()}}},UY=(Y)=>{let Z=Object.create(fX);if(Z.status=Y.status,Z.statusText=Y.statusText,Z.cookies=Y.cookies??a0,Z.body=Y.body??QZ,Z.body._tag!=="Empty"&&(Z.body.contentType||Z.body.contentLength)){let $=wY({...Y.headers});if(Z.body.contentType)$["content-type"]=Z.body.contentType;if(Z.body.contentLength)$["content-length"]=Z.body.contentLength.toString();Z.headers=$}else Z.headers=Y.headers??n;return Z};var oY="~effect/http/HttpServerRespondable",E8=(Y)=>q(Y,oY),cX=t({status:400}),dX=t({status:404});var I8=(Y,Z)=>{if(AY(Y))return F(Y);else if(E8(Y))return K0(Y[oY](),()=>F(Z));else if(H8(Y))return F(cX);else if(w8(Y))return F(dX);return F(Z)},P8=(Y,Z)=>{if(AY(Y))return F(Y);else if(E8(Y))return K0(Y[oY](),()=>F(Z));return F(Z)};var j8="~effect/http/HttpServerError";class l extends P("HttpServerError"){constructor(Y){if("cause"in Y.reason)super({...Y,cause:Y.reason.cause});else super(Y)}[j8]=j8;stack=`${this.name}: ${this.message}`;get request(){return this.reason.request}get response(){return"response"in this.reason?this.reason.response:void 0}[oY](){return this.reason[oY]()}get[RZ](){return this.reason[RZ]??!1}get message(){return this.reason.message}}class JY extends P("RequestParseError"){[oY](){return F(t({status:400}))}get methodAndUrl(){return`${this.request.method} ${this.request.url}`}get message(){return g8(this._tag,this.description,this.methodAndUrl)}}class v5 extends P("RouteNotFound"){[oY](){return F(t({status:404}))}[RZ]=!0;get methodAndUrl(){return`${this.request.method} ${this.request.url}`}get message(){return g8(this._tag,this.description,this.methodAndUrl)}}class _1 extends S()("effect/http/HttpServerError/ClientAbort"){static annotation=this.context(!0).pipe(gZ(S8,{name:"ClientAbort",stack:v8,parent:void 0}))}var g8=(Y,Z,$)=>{let J=`${Y} (${$})`;return Z?`${J}: ${Z}`:J},R5=(Y)=>{let Z,$=lX,J=[],Q=[],X=!1;for(let G=0;G<Y.reasons.length;G++){let K=Y.reasons[G];switch(K._tag){case"Fail":{$=I8(K.error,z1),J.push(K);break}case"Die":{if(AY(K.defect))Z=K.defect;else $=P8(K.defect,z1),J.push(K);break}case"Interrupt":{if(X=K.annotations.has(_1.key),J.length>0)break;Q.push(K);break}}}if(Z)return F([Z,V1(J)]);else if(Q.length>0&&J.length===0)J.push(...Q),$=X?iX:pX;return V0($,(G)=>{return J.push(R8(G)),[G,V1(J)]})},S5=(Y)=>{let Z,$=Y.reasons.filter((J)=>{if(J._tag==="Die"&&AY(J.defect))return Z=J.defect,!1;return!0});return[Z??z1,$.length>0?b(V1($)):H()]},z1=t({status:500}),lX=F(z1),iX=F(t({status:499})),pX=F(t({status:503})),C8=(Y)=>{if(Y._tag==="Success")return Y.value;return S5(Y.cause)[0]};var A0={};kY(A0,{upgradeChannel:()=>E4,toWebResult:()=>u5,toWeb:()=>u4,toURL:()=>W0,toClientRequest:()=>q4,searchParamsFromURL:()=>m$,schemaSearchParams:()=>j4,schemaHeaders:()=>P4,schemaCookies:()=>I4,schemaBodyUrlParams:()=>S4,schemaBodyMultipart:()=>g4,schemaBodyJson:()=>v4,schemaBodyFormJson:()=>C4,schemaBodyForm:()=>R4,fromWeb:()=>f5,fromClientRequest:()=>b4,TypeId:()=>OZ,ParsedSearchParams:()=>xY,MaxBodySize:()=>rZ,HttpServerRequest:()=>M});var B1="~effect/socket/Socket/SocketError",rX=(Y)=>q(Y,B1);class s8 extends tY("effect/socket/Socket/SocketReadError")({_tag:mY("SocketReadError"),cause:AZ}){message="An error occurred during Read"}class t8 extends tY("effect/socket/Socket/SocketWriteError")({_tag:mY("SocketWriteError"),cause:AZ}){message="An error occurred during Write"}class e8 extends tY("effect/socket/Socket/SocketOpenError")({_tag:mY("SocketOpenError"),kind:I0(["Unknown","Timeout"]),cause:AZ}){get message(){return this.kind==="Timeout"?'timeout waiting for "open"':"An error occurred during Open"}}class Y$ extends tY("effect/socket/Socket/SocketCloseError")({_tag:mY("SocketCloseError"),code:o8,closeReason:E0(IY)}){static filterClean(Y){return function(Z){return Z$.is(Z)&&Z.reason._tag==="SocketCloseError"&&Y(Z.reason.code)?PY(Z.reason):h(Z)}}get message(){if(this.closeReason)return`${this.code}: ${this.closeReason}`;return`${this.code}`}}var sX=k0([s8,t8,e8,Y$]);class Z$ extends r8(B1)("SocketError",{_tag:mY("SocketError"),reason:sX}){constructor(Y){if("cause"in Y.reason)super({...Y,cause:Y.reason.cause});else super(Y)}[B1]=B1;static is(Y){return rX(Y)}message=this.reason.message}var tX=(Y,Z)=>D1(_0(function*($,J){let Q=yield*u8(),X=yield*y8(J),G=yield*x8(Y.writer,X),K,z=0,_=h8({while:()=>z<K.length,body:()=>G(K[z++]),step:b8});return yield*$.pipe(U((B)=>{if(B.length===1)return G(B[0]);return K=B,z=0,_}),d8({disableYield:!0}),f8(m8,(B)=>i8(Q,B)),c8(z0(X,O1)),g5(J)),yield*Y.runRaw((B)=>{l8(Q,Z(B))}).pipe(n8(Q),g5(J)),p8(Q)})),eX=(Y)=>{let Z=new TextEncoder;return tX(Y,($)=>typeof $==="string"?Z.encode($):$)};var $$=()=>(Y)=>eX(Y);var J$=/; *([!#$%&'*+.^\w`|~-]+)=("(?:[\v\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\v\u0020-\u00ff])*"|[!#$%&'*+.^\w`|~-]+) */gu,Q$=/\\([\v\u0020-\u00ff])/gu,Z4=/^[!#$%&'*+.^\w|~-]+\/[!#$%&'*+.^\w|~-]+$/u,$4=/^[!#$%&'*+.^\w|~-]+$/u,W1={value:"",parameters:Object.create(null)};function A1(Y,Z=!1){if(typeof Y!=="string")return W1;let $=Y.indexOf(";"),J=$!==-1?Y.slice(0,$).trim():Y.trim();if((Z?$4:Z4).test(J)===!1)return W1;let X={value:J.toLowerCase(),parameters:Object.create(null)};if($===-1)return X;let G,K,z;J$.lastIndex=$;while(K=J$.exec(Y)){if(K.index!==$)return W1;if($+=K[0].length,G=K[1].toLowerCase(),z=K[2],z[0]==='"')z=z.slice(1,z.length-1),!Z&&Q$.test(z)&&(z=z.replace(Q$,"$1"));X.parameters[G]=z}if($!==Y.length)return W1;return X}var QY;(function(Y){Y[Y.key=0]="key",Y[Y.whitespace=1]="whitespace",Y[Y.value=2]="value"})(QY||(QY={}));var B0={_tag:"Continue"},Q4=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,0,0,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1],X4=[0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1];function X$(){let Y=new TextDecoder,Z={state:QY.key,headers:Object.create(null),key:"",value:void 0,crlf:0,previousChunk:void 0,pairs:0,size:0};function $(X){return Z.state=QY.key,Z.headers=Object.create(null),Z.key="",Z.value=void 0,Z.crlf=0,Z.previousChunk=void 0,Z.pairs=0,Z.size=0,X}function J(X,G){let K=new Uint8Array(X.length+G.length);return K.set(X),K.set(G,X.length),K}function Q(X){return $({_tag:"Failure",reason:X,headers:Z.headers})}return function(G,K){let z=0,_;if(Z.previousChunk!==void 0){z=Z.previousChunk.length,_=z;let V=new Uint8Array(G.length+z);V.set(Z.previousChunk),V.set(G,z),Z.previousChunk=void 0,G=V}let B=G.length;Y:while(K<B){if(Z.state===QY.key){let V=K;for(;V<B;V++){if(Z.size++>16384)return Q("HeaderTooLarge");if(G[V]===58){if(Z.key+=Y.decode(G.subarray(K,V)).toLowerCase(),Z.key.length===0)return Q("InvalidHeaderName");if(G[V+1]===32&&G[V+2]!==32&&G[V+2]!==9)K=V+2,Z.state=QY.value,Z.size++;else if(G[V+1]!==32&&G[V+1]!==9)K=V+1,Z.state=QY.value;else K=V+1,Z.state=QY.whitespace;break}else if(Q4[G[V]]!==1)return Q("InvalidHeaderName")}if(V===B)return Z.key+=Y.decode(G.subarray(K,B)).toLowerCase(),B0}if(Z.state===QY.whitespace){for(;K<B;K++){if(Z.size++>16384)return Q("HeaderTooLarge");if(G[K]!==32&&G[K]!==9){Z.state=QY.value;break}}if(K===B)return B0}if(Z.state===QY.value){let V=K;if(_!==void 0)V=_,_=void 0;for(;V<B;V++){if(Z.size++>16384)return Q("HeaderTooLarge");if(G[V]===13||Z.crlf>0){let D=G[V];if(D===13&&Z.crlf===0)Z.crlf=1,V++,Z.size++,D=G[V];if(D===10&&Z.crlf===1)Z.crlf=2,V++,Z.size++,D=G[V];if(D===13&&Z.crlf===2)Z.crlf=3,V++,Z.size++,D=G[V];if(D===10&&Z.crlf===3)Z.crlf=4,V++,Z.size++;if(Z.crlf<4&&V>=B)return Z.previousChunk=G.subarray(K),B0;else if(Z.crlf>=2){Z.value=Z.value===void 0?G.subarray(K,V-Z.crlf):J(Z.value,G.subarray(K,V-Z.crlf));let A=Y.decode(Z.value);if(Z.headers[Z.key]===void 0)Z.headers[Z.key]=A;else if(typeof Z.headers[Z.key]==="string")Z.headers[Z.key]=[Z.headers[Z.key],A];else Z.headers[Z.key].push(A);if(K=V,Z.size--,Z.crlf!==4&&Z.pairs===100)return Q("TooManyHeaders");else if(Z.crlf===3)return Q("InvalidHeaderValue");else if(Z.crlf===4)return $({_tag:"Headers",headers:Z.headers,endPosition:K-z});Z.pairs++,Z.key="",Z.value=void 0,Z.crlf=0,Z.state=QY.key;continue Y}}else if(X4[G[V]]!==1)return Q("InvalidHeaderValue")}if(V===B)return Z.value=Z.value===void 0?G.subarray(K,B):J(Z.value,G.subarray(K,B)),B0}}if(K>B)Z.size+=B-K;return B0}}function K4(Y){let Z=new TextEncoder().encode(Y),$=Z.length,J={};for(let Q=0;Q<$;Q++){let X=Z[Q];if(J[X]===void 0)J[X]=[];J[X].push(Q)}return{needle:Z,needleLength:$,indexes:J,firstByte:Z[0],previousChunk:void 0,previousChunkLength:0,matchIndex:0}}function G$(Y,Z,$){let J=K4(Y);if($!==void 0)J.previousChunk=$,J.previousChunkLength=$.length;function Q(){if("Buffer"in globalThis&&!(("Bun"in globalThis)||("Deno"in globalThis)))return function(_,B,V){return Buffer.prototype.indexOf.call(_,B,V)};let z=new Uint8Array(256).fill(J.needle.length);for(let _=0,B=J.needle.length-1;_<B;++_)z[J.needle[_]]=B-_;return function(_,B,V){let D=_.length,A=V+J.needleLength-1;while(A<D){for(let W=J.needleLength-1,N=A;W>=0&&_[N]===B[W];W--,N--)if(W===0)return N;A+=z[_[A]]}return-1}}let X=Q();function G(z){let _=z.length;if(J.previousChunk!==void 0){let V=new Uint8Array(J.previousChunkLength+_);V.set(J.previousChunk),V.set(z,J.previousChunkLength),z=V,_=J.previousChunkLength+_,J.previousChunk=void 0}if(_<J.needleLength){J.previousChunk=z,J.previousChunkLength=_;return}let B=0;while(B<_){let V=X(z,J.needle,B);if(V>-1){if(V>B)Z(J.matchIndex,z.subarray(B,V));J.matchIndex+=1,B=V+J.needleLength;continue}else if(z[_-1]in J.indexes){let D=J.indexes[z[_-1]],A=-1;for(let W=0,N=D.length;W<N;W++){let T=D[W];if(z[_-1-T]===J.firstByte&&W>A)A=T}if(A===-1)if(B===0)Z(J.matchIndex,z);else Z(J.matchIndex,z.subarray(B));else{if(_-1-A>B)Z(J.matchIndex,z.subarray(B,_-1-A));J.previousChunk=z.subarray(_-1-A),J.previousChunkLength=A+1}}else if(B===0)Z(J.matchIndex,z);else Z(J.matchIndex,z.subarray(B));break}}function K(){if(J.previousChunk!==void 0&&J.previousChunk!==$)Z(J.matchIndex,J.previousChunk);J.previousChunk=$,J.previousChunkLength=$?.length??0,J.matchIndex=0}return{write:G,end:K}}var CY;(function(Y){Y[Y.headers=0]="headers",Y[Y.body=1]="body"})(CY||(CY={}));var z4={_tag:"InvalidDisposition"},_4={_tag:"EndNotReached"},B4={_tag:"ReachedLimit",limit:"MaxParts"},O4={_tag:"ReachedLimit",limit:"MaxTotalSize"},D4={_tag:"ReachedLimit",limit:"MaxPartSize"},K$={_tag:"ReachedLimit",limit:"MaxFieldSize"},W4=new TextEncoder().encode(`\r
|
|
3
3
|
`);function b5(Y){return Y.filename!==void 0||Y.contentType==="application/octet-stream"}function A4(Y){return A1(Y["content-type"]).parameters.boundary}function U1(Y){}function z$({headers:Y,onFile:Z,onField:$,onError:J,onDone:Q,isFile:X=b5,maxParts:G=1/0,maxTotalSize:K=1/0,maxPartSize:z=1/0,maxFieldSize:_=1048576}){let B=A4(Y);if(B===void 0)return J({_tag:"InvalidBoundary"}),{write:U1,end(){}};let V={state:CY.headers,index:0,parts:0,onChunk:U1,info:void 0,headerSkip:0,partSize:0,totalSize:0,isFile:!1,fieldChunks:[],fieldSize:0};function D(){V.state=CY.body,V.isFile=!0,V.onChunk=U1}let A=X$(),W=G$(`\r
|
|
4
|
-
--${B}`,function(N,T){if(N===0){D();return}else if(N!==V.index){if(V.index>0)if(V.isFile)V.onChunk(null),V.partSize=0;else{if(V.fieldChunks.length===1)$(V.info,V.fieldChunks[0]);else{let E=new Uint8Array(V.fieldSize),YY=0;for(let I=0;I<V.fieldChunks.length;I++){let p=V.fieldChunks[I];E.set(p,YY),YY+=p.length}$(V.info,E)}V.fieldSize=0,V.fieldChunks=[]}if(V.state=CY.headers,V.index=N,V.headerSkip=2,T[0]===45&&T[1]===45)return Q();if(V.parts++,V.parts>G)J(B4)}if((V.partSize+=T.length)>z)J(D4);if(V.state===CY.headers){let E=A(T,V.headerSkip);if(V.headerSkip=0,E._tag==="Continue")return;else if(E._tag==="Failure")return D(),J({_tag:"BadHeaders",error:E});let YY=A1(E.headers["content-type"]),I=A1(E.headers["content-disposition"],!0);if(I.value==="form-data"&&!("name"in I.parameters))return D(),J(z4);let p;if("filename*"in I.parameters){let w=I.parameters["filename*"].split("''");if(w.length===2)p=decodeURIComponent(w[1])}if(V.info={name:I.parameters.name??"",filename:p??I.parameters.filename,contentType:YY.value===""?I.parameters.filename!==void 0?"application/octet-stream":"text/plain":YY.value,contentTypeParameters:YY.parameters,contentDisposition:I.value,contentDispositionParameters:I.parameters,headers:E.headers},V.state=CY.body,V.isFile=X(V.info),V.isFile)V.onChunk=Z(V.info);if(E.endPosition<T.length)if(V.isFile)V.onChunk(T.subarray(E.endPosition));else{let w=T.subarray(E.endPosition);if((V.fieldSize+=w.length)>_)J(K$);V.fieldChunks.push(w)}}else if(V.isFile)V.onChunk(T);else{if((V.fieldSize+=T.length)>_)J(K$);V.fieldChunks.push(T)}},W4);return{write(N){if((V.totalSize+=N.length)>K)return J(O4);return W.write(N)},end(){if(W.end(),V.state===CY.body)J(_4);V.state=CY.headers,V.index=0,V.parts=0,V.onChunk=U1,V.info=void 0,V.totalSize=0,V.partSize=0,V.fieldChunks=[],V.fieldSize=0}}}var V$=new TextDecoder("utf-8");function U4(Y){if(Y==="utf-8"||Y==="utf8"||Y==="")return V$;try{return new TextDecoder(Y)}catch(Z){return V$}}function _$(Y,Z){return U4(Y.contentTypeParameters.charset??"utf-8").decode(Z)}var B$=z$,O$=b5,D$=_$;var NY="~effect/http/Multipart";var W$="~effect/http/Multipart/MultipartError";class j$ extends n0{}class k extends P("MultipartError"){static fromReason(Y,Z){return new k({reason:new j$({_tag:Y,cause:Z})})}[W$]=W$;get message(){return this.reason._tag}}var y5=(Y)=>f(Y),v$=(Y,Z)=>{let $=w$(Y);return O(2,(J,Q)=>L(f(T$({[Q]:$}))(J,Z),(X)=>X[Q]))},L4=(Y)=>u((Z)=>{let $=y(Z.context,x$);return F({headers:Y,maxParts:Z.getRef(C$),maxFieldSize:Number(Z.getRef(b$)),maxPartSize:D0(Z.getRef(q$),Number),maxTotalSize:D0(Z.getRef(rZ),Number),isFile:$.length===0?void 0:(J)=>!$.some((Q)=>J.contentType.includes(Q))&&O$(J)})}),k5=(Y)=>D1((Z)=>L(L4(Y),($)=>{let J=[],Q=H(),X=B$({...$,onField(K,z){J.push(new R$(K.name,K.contentType,D$(K,z)))},onFile(K){let z=[],_=!1,B=L$(F(_Z(function V(){if(!q5(z))return _?U$():U(G,V);let D=z;return z=[],F(D)})));return J.push(new S$(K,B)),function(V){if(V===null)_=!0;else z.push(V)}},onError(K){Q=b(x5(M4(K)))},onDone(){Q=b(x5(A$()))}}),G=Z.pipe(U((K)=>{for(let z=0;z<K.length;z++)X.write(K[z]);return e}),K0((K)=>{if(N$(K))X.end();else Q=b(F$(K));return e}));return G.pipe(U(function K(){if(!q5(J)){if(r(Q))return Q.value;return U(G,K)}let z=J;return J=[],F(z)}))}));function M4(Y){switch(Y._tag){case"ReachedLimit":switch(Y.limit){case"MaxParts":return k.fromReason("TooManyParts",Y);case"MaxFieldSize":return k.fromReason("FieldTooLarge",Y);case"MaxPartSize":return k.fromReason("FileTooLarge",Y);case"MaxTotalSize":return k.fromReason("BodyTooLarge",Y)}default:return k.fromReason("Parse",Y)}}class F1 extends RY{[NY];constructor(){super();this[NY]=NY}}class R$ extends F1{_tag="Field";key;contentType;value;constructor(Y,Z,$){super();this.key=Y,this.contentType=Z,this.value=$}toJSON(){return{_id:"@effect/platform/Multipart/Part",_tag:"Field",key:this.key,contentType:this.contentType,value:this.value}}}class S$ extends F1{_tag="File";key;name;contentType;content;contentEffect;constructor(Y,Z){super();this.key=Y.name,this.name=Y.filename??Y.name,this.contentType=Y.contentType,this.content=H$(Z),this.contentEffect=Z.pipe(w4,JZ(($)=>k.fromReason("InternalError",$)))}toJSON(){return{_id:"@effect/platform/Multipart/Part",_tag:"File",key:this.key,name:this.name,contentType:this.contentType}}}var T4=(Y,Z)=>U(dY.asEffect(),($)=>JZ(E$(Z.content,$.sink(Y)),(J)=>k.fromReason("InternalError",J))),w4=(Y)=>M$(Y,DY(new Uint8Array(0)),(Z,$)=>{let J=$.reduce((G,K)=>G+K.length,Z.length),Q=new Uint8Array(J);Q.set(Z,0);let X=Z.length;for(let G of $)Q.set(G,X),X+=G.length;return Q}),m5=(Y,Z=T4)=>i(function*(){let $=yield*dY,J=yield*P$,Q=yield*$.makeTempDirectoryScoped(),X=Object.create(null);return yield*I$(Y,(G)=>{if(G._tag==="Field"){if(!(G.key in X))X[G.key]=G.value;else if(typeof X[G.key]==="string")X[G.key]=[X[G.key],G.value];else X[G.key].push(G.value);return e}else if(G.name==="")return e;let K=G,z=J.join(Q,J.basename(K.name).slice(-128)),_=new g$(K.key,K.name,K.contentType,z);if(Array.isArray(X[G.key]))X[G.key].push(_);else X[G.key]=[_];return Z(z,K)}),X}).pipe(X1("PlatformError",($)=>g(k.fromReason("InternalError",$))));class g$ extends F1{_tag="PersistedFile";key;name;contentType;path;constructor(Y,Z,$,J){super();this.key=Y,this.name=Z,this.contentType=$,this.path=J}toJSON(){return{_id:"@effect/platform/Multipart/Part",_tag:"PersistedFile",key:this.key,name:this.name,contentType:this.contentType,path:this.path}}}var c3=(Y)=>{let Z=new Map;if(Y.maxParts!==void 0)Z.set(C$.key,Y.maxParts);if(Y.maxFieldSize!==void 0)Z.set(b$.key,O0(Y.maxFieldSize));if(Y.maxFileSize!==void 0)Z.set(q$.key,D0(Y.maxFileSize,O0));if(Y.maxTotalSize!==void 0)Z.set(rZ.key,D0(Y.maxTotalSize,O0));if(Y.fieldMimeTypes!==void 0)Z.set(x$.key,Y.fieldMimeTypes);return bY(Z)},C$=j("effect/http/Multipart/MaxParts",{defaultValue:()=>{return}}),b$=j("effect/http/Multipart/MaxFieldSize",{defaultValue:DY(O0(10485760))}),q$=j("effect/http/Multipart/MaxFileSize",{defaultValue:()=>{return}}),x$=j("effect/http/Multipart/FieldMimeTypes",{defaultValue:DY(["application/json"])});var OZ="~effect/http/HttpServerRequest",M=S("effect/http/HttpServerRequest");class xY extends S()("effect/http/ParsedSearchParams"){}var m$=(Y)=>{let Z={};for(let[$,J]of Y.searchParams.entries()){let Q=Z[$];if(Q!==void 0)if(Array.isArray(Q))Q.push(J);else Z[$]=[Q,J];else Z[$]=J}return Z},E4=()=>M.asEffect().pipe(U((Y)=>Y.upgrade),L($$()),C5),I4=(Y,Z)=>{let $=f(Y);return U(M.asEffect(),(J)=>$(J.cookies,Z))},P4=(Y,Z)=>{let $=f(Y);return U(M.asEffect(),(J)=>$(J.headers,Z))},j4=(Y,Z)=>{let $=f(Y);return U(xY.asEffect(),(J)=>$(J,Z))},v4=(Y,Z)=>{let $=s0(Y,Z);return U(M.asEffect(),$)},h$=(Y)=>Y.headers["content-type"]?.toLowerCase().includes("multipart/form-data")===!0||k4(Y)!==void 0,R4=(Y,Z)=>{let $=y5(Y),J=oZ(Y,Z);return U(M.asEffect(),(Q)=>{if(h$(Q))return U(Q.multipart,(X)=>$(X,Z));return J(Q)})},S4=(Y,Z)=>{let $=oZ(Y,Z);return U(M.asEffect(),$)},g4=(Y,Z)=>{let $=y5(Y);return M.asEffect().pipe(U((J)=>J.multipart),U((J)=>$(J,Z)))},C4=(Y,Z)=>{let $=v$(Y,Z);return(J)=>{let Q=b6(J).pipe(cY(Y),iY);return U(M.asEffect(),(X)=>{if(h$(X))return U(JZ(X.multipart,(G)=>new l({reason:new JY({request:X,cause:G})})),$(J));return U(X.urlParamsBody,(G)=>Q(G,Z))})}},b4=(Y)=>{let Z=BY(o1(Y),{onNone:()=>Y.url,onSome:($)=>$.toString()});return new d5(Y,Z)},f5=(Y)=>new c5(Y,f$(Y.url)),q4=(Y)=>EZ(R(Y.method,"",m0,H(),Y.headers,x4(Y)),L1(W0(Y),()=>Y.url)),x4=(Y)=>TZ(Y.method)?jY(Y.stream,Y.headers["content-type"],y4(Y.headers["content-length"])):QZ,y4=(Y)=>{if(Y===void 0)return;let Z=Number.parseInt(Y,10);return Number.isNaN(Z)?void 0:Z},f$=(Y)=>{if(Y[0]==="/")return Y;let Z=Y.indexOf("/",Y.indexOf("//")+2);return Z===-1?"/":Y.slice(Z)};class c5 extends RY{[OZ];[c];source;url;headersOverride;remoteAddressOverride;constructor(Y,Z,$,J){super();this[OZ]=OZ,this[c]=c,this.source=Y,this.url=Z,this.headersOverride=$,this.remoteAddressOverride=J}toJSON(){return sZ(this,{_id:"HttpServerRequest",method:this.method,url:this.originalUrl})}modify(Y){return new c5(this.source,Y.url??this.url,Y.headers??this.headersOverride,"remoteAddress"in Y?Y.remoteAddress:this.remoteAddressOverride)}get method(){return this.source.method.toUpperCase()}get originalUrl(){return this.source.url}get remoteAddress(){return this.remoteAddressOverride??H()}get headers(){return this.headersOverride??=C(this.source.headers),this.headersOverride}cachedCookies;get cookies(){if(this.cachedCookies)return this.cachedCookies;return this.cachedCookies=Z5(this.headers.cookie??"")}get stream(){return this.source.body?SY({evaluate:()=>this.source.body,onError:(Y)=>new l({reason:new JY({request:this,cause:Y})})}):tZ(new l({reason:new JY({request:this,description:"can not create stream from empty body"})}))}textEffect;get text(){if(this.textEffect)return this.textEffect;return this.textEffect=o(OY(d({try:()=>this.source.text(),catch:(Y)=>new l({reason:new JY({request:this,cause:Y})})}))),this.textEffect}get json(){return U(this.text,(Y)=>GY({try:()=>JSON.parse(Y),catch:(Z)=>new l({reason:new JY({request:this,cause:Z})})}))}get urlParamsBody(){return U(this.text,(Y)=>GY({try:()=>a(new URLSearchParams(Y)),catch:(Z)=>new l({reason:new JY({request:this,cause:Z})})}))}multipartEffect;get multipart(){if(this.multipartEffect)return this.multipartEffect;return this.multipartEffect=o(OY(m5(this.multipartStream))),this.multipartEffect}get multipartStream(){return h5(X0(this.stream,(Y)=>k.fromReason("InternalError",Y)),k5(this.headers))}arrayBufferEffect;get arrayBuffer(){if(this.arrayBufferEffect)return this.arrayBufferEffect;return this.arrayBufferEffect=o(OY(d({try:()=>this.source.arrayBuffer(),catch:(Y)=>new l({reason:new JY({request:this,cause:Y})})}))),this.arrayBufferEffect}get upgrade(){return g(new l({reason:new JY({request:this,description:"Not an upgradeable ServerRequest"})}))}}class d5 extends RY{[OZ];[c];source;originalUrl;headersOverride;remoteAddressOverride;urlOverride;constructor(Y,Z,$,J,Q){super();this[OZ]=OZ,this[c]=c,this.source=Y,this.originalUrl=Z,this.urlOverride=$,this.headersOverride=J,this.remoteAddressOverride=Q}toJSON(){return sZ(this,{_id:"HttpServerRequest",method:this.method,url:this.originalUrl})}modify(Y){return new d5(this.source,this.originalUrl,Y.url??this.url,Y.headers??this.headersOverride,"remoteAddress"in Y?Y.remoteAddress:this.remoteAddressOverride)}get method(){return this.source.method}get url(){return this.urlOverride??f$(this.originalUrl)}get remoteAddress(){return this.remoteAddressOverride??H()}get headers(){return this.headersOverride??=this.source.headers}cachedCookies;get cookies(){if(this.cachedCookies)return this.cachedCookies;return this.cachedCookies=Z5(this.headers.cookie??"")}get stream(){let Y=this.source.body;switch(Y._tag){case"Empty":return K1;case"Uint8Array":return I5(Y.body);case"Stream":return X0(Y.stream,(Z)=>qY(this,void 0,Z));case"FormData":return N1(this,new Response(Y.formData).body);case"Raw":return m4(this,Y.body)}}bytesEffect;get bytes(){if(this.bytesEffect)return this.bytesEffect;let Y=this.source.body,Z;switch(Y._tag){case"Empty":{Z=F(new Uint8Array(0));break}case"Uint8Array":{Z=F(Y.body);break}case"FormData":{Z=c$(this,Y.formData);break}case"Stream":{Z=P5(this.stream);break}case"Raw":{Z=h4(this,Y.body);break}}return this.bytesEffect=o(OY(Z)),this.bytesEffect}get text(){return L(this.bytes,(Y)=>d4.decode(Y))}get json(){return U(this.text,(Y)=>GY({try:()=>Y===""?null:JSON.parse(Y),catch:(Z)=>qY(this,void 0,Z)}))}get urlParamsBody(){return U(this.text,(Y)=>GY({try:()=>a(new URLSearchParams(Y)),catch:(Z)=>qY(this,void 0,Z)}))}multipartEffect;get multipart(){if(this.multipartEffect)return this.multipartEffect;return this.multipartEffect=o(OY(m5(this.multipartStream))),this.multipartEffect}get multipartStream(){let Y=this.source.body._tag==="FormData"&&this.source.body.formData;if(Y)return k$(f4(Y));return h5(X0(this.stream,(Z)=>k.fromReason("InternalError",Z)),k5(this.headers))}get arrayBuffer(){return L(this.bytes,(Y)=>Y.slice().buffer)}get upgrade(){return g(qY(this,"Not an upgradeable ServerRequest"))}}var k4=(Y)=>{if(!KZ(Y.source))return;let Z=Y.source.body;if(Z._tag==="FormData")return Z.formData;if(Z._tag==="Raw"&&l$(Z.body))return Z.body;return},m4=(Y,Z)=>{if(Z instanceof Request)return N1(Y,Z.body);if(l$(Z))return N1(Y,new Response(Z).body);if(c4(Z))return N1(Y,Z);return tZ(qY(Y,"Unsupported body type"))},h4=(Y,Z)=>{if(Z instanceof Blob)return c$(Y,Z);if(Z instanceof Request)return d({try:()=>Z.arrayBuffer().then(($)=>new Uint8Array($)),catch:($)=>qY(Y,void 0,$)});return g(qY(Y,"Unsupported body type"))},c$=(Y,Z)=>d({try:()=>new Response(Z).arrayBuffer().then(($)=>new Uint8Array($)),catch:($)=>qY(Y,void 0,$)}),N1=(Y,Z)=>Z?SY({evaluate:()=>Z,onError:($)=>qY(Y,void 0,$)}):K1,qY=(Y,Z,$)=>new l({reason:new JY({request:Y,...Z===void 0?void 0:{description:Z},...$===void 0?void 0:{cause:$}})}),f4=(Y)=>{let Z=[];for(let[$,J]of Y.entries())Z.push(typeof J==="string"?new d$($,J):new u$($,J));return Z};class d$ extends RY{[NY];_tag="Field";contentType="text/plain";key;value;constructor(Y,Z){super();this[NY]=NY,this.key=Y,this.value=Z}toJSON(){return{_id:"@effect/platform/Multipart/Part",_tag:"Field",key:this.key,contentType:this.contentType,value:this.value}}}class u$ extends RY{[NY];_tag="File";key;name;contentType;content;contentEffect;constructor(Y,Z){super();this[NY]=NY,this.key=Y,this.name=Z.name,this.contentType=Z.type,this.content=SY({evaluate:()=>Z.stream(),onError:($)=>k.fromReason("InternalError",$)}),this.contentEffect=d({try:()=>Z.arrayBuffer().then(($)=>new Uint8Array($)),catch:($)=>k.fromReason("InternalError",$)})}toJSON(){return{_id:"@effect/platform/Multipart/Part",_tag:"File",key:this.key,name:this.name,contentType:this.contentType}}}var c4=(Y)=>typeof ReadableStream<"u"&&Y instanceof ReadableStream,l$=(Y)=>typeof FormData<"u"&&Y instanceof FormData,d4=new TextDecoder,W0=(Y)=>{let Z=Y.headers.host??"localhost",$=Y.headers["x-forwarded-proto"]==="https"?"https":"http";try{return b(new URL(Y.url,`${$}://${Z}`))}catch{return H()}},u5=(Y,Z)=>{if(Y.source instanceof Request)return PY(Y.source);let $=W0(Y);if(y$($))return h(new JY({request:Y,description:"Invalid URL"}));let J={method:Y.method,headers:Y.headers};if(Z?.signal)J.signal=Z.signal;if(TZ(Y.method))J.body=wZ(Y.stream,Z?.context??GZ()),J.duplex="half";return PY(new Request($.value,J))},u4=(Y,Z)=>ZY(($)=>u5(Y,{context:$,signal:Z?.signal}).asEffect());var U0=new WeakMap,M1=(Y,Z)=>{let $=U0.get(Y.source),J=$?(Q,X)=>U($(Q,X),(G)=>Z(Q,G)):Z;U0.set(Y.source,J)};var o$=(Y)=>Y,r$=new WeakSet,l4=(Y)=>{let Z=Y.indexOf("?"),$=Y.indexOf("#");if(Z===-1)return $===-1?Y:Y.slice(0,$);if($===-1)return Y.slice(0,Z);return Y.slice(0,Math.min(Z,$))},s$=(Y)=>u((Z)=>{let $=zY(Z.context,M);return r$.add($.source),Y}),i4=j("effect/http/HttpMiddleware/TracerDisabledWhen",{defaultValue:()=>$1});var p4=j("@effect/platform/HttpMiddleware/SpanNameGenerator",{defaultValue:()=>(Y)=>`http.server ${Y.method}`}),N0=o$((Y)=>{let Z=0;return u(($)=>{let J=zY($.context,M),Q=l4(J.url);return a$(U(n$(Y),(X)=>{if(r$.has(J.source))return X;else if(X._tag==="Failure"){let[G,K]=S5(X.cause);return $0(l5(F0(L1(K,()=>"Sent HTTP Response")),{"http.method":J.method,"http.url":Q,"http.status":G.status}),X)}return $0(l5(F0("Sent HTTP response"),{"http.method":J.method,"http.url":Q,"http.status":X.value.status}),X)}),`http.span.${++Z}`)})}),i5=o$((Y)=>u((Z)=>{let $=zY(Z.context,M);if(!Z.getRef(p$)||Z.getRef(i4)($))return Y;let Q=Z.getRef(p4),X=i$(Z,Q($),{parent:XZ(w7($.headers)),kind:"server"}),G=Z.context;return Z.setContext(gZ(Z.context,T1,X)),w1(Y,(K)=>{Z.setContext(G);let z=Z.getRef(J1).currentTimeNanosUnsafe();Z.currentDispatcher.scheduleTask(()=>{let _=W0($);if(r(_)&&(_.value.username!==""||_.value.password!==""))_.value.username="REDACTED",_.value.password="REDACTED";let B=Z.getRef(cZ),V=YZ($.headers,B);if(X.attribute("http.request.method",$.method),r(_)){if(X.attribute("url.full",_.value.toString()),X.attribute("url.path",_.value.pathname),_.value.search.slice(1)!=="")X.attribute("url.query",_.value.search.slice(1));X.attribute("url.scheme",_.value.protocol.slice(0,-1))}if($.headers["user-agent"]!==void 0)X.attribute("user_agent.original",$.headers["user-agent"]);for(let W in V)X.attribute(`http.request.header.${W}`,String(V[W]));if(r($.remoteAddress))X.attribute("client.address",$.remoteAddress.value);let D=C8(K);X.attribute("http.response.status_code",D.status);let A=YZ(D.headers,B);for(let W in A)X.attribute(`http.response.header.${W}`,String(A[W]));X.end(z,K)},0);return},!0)}));var t$=(Y)=>{let Z={allowedOrigins:Y?.allowedOrigins??[],allowedMethods:Y?.allowedMethods??["GET","HEAD","PUT","PATCH","POST","DELETE"],allowedHeaders:Y?.allowedHeaders??[],exposedHeaders:Y?.exposedHeaders??[],credentials:Y?.credentials??!1,maxAge:Y?.maxAge},$=typeof Z.allowedOrigins==="function"?Z.allowedOrigins:(D)=>Z.allowedOrigins.includes(D),J=typeof Z.allowedOrigins==="function"||Z.allowedOrigins.length>1?(D)=>{if(!$(D))return;return{"access-control-allow-origin":D,vary:"Origin"}}:Z.allowedOrigins.length===0?DY({"access-control-allow-origin":"*"}):DY({"access-control-allow-origin":Z.allowedOrigins[0],vary:"Origin"}),Q=Z.allowedMethods.length>0?{"access-control-allow-methods":Z.allowedMethods.join(", ")}:void 0,X=Z.credentials?{"access-control-allow-credentials":"true"}:void 0,G=(D)=>{if(Z.allowedHeaders.length===0&&D)return{vary:"Access-Control-Request-Headers","access-control-allow-headers":D};if(Z.allowedHeaders)return{"access-control-allow-headers":Z.allowedHeaders.join(",")};return},K=Z.exposedHeaders.length>0?{"access-control-expose-headers":Z.exposedHeaders.join(",")}:void 0,z=Z.maxAge?{"access-control-max-age":Z.maxAge.toString()}:void 0,_=(D)=>{let A=D.headers.origin;return wY({...J(A),...X,...K})},B=(D)=>{let A=D.headers.origin,W=D.headers["access-control-request-headers"];return wY({...J(A),...X,...K,...Q,...G(W),...z})},V=(D,A)=>F(L8(A,_(D)));return(D)=>u((A)=>{let W=zY(A.context,M);if(W.method==="OPTIONS")return F(t({status:204,headers:B(W)}));return M1(W,V),D})};var a4=(Y,Z,$)=>{let Q=jZ(Y,{onSuccess:(G)=>{let K=nY(),z=zY(K.context,M),_=U0.get(z.source);if(_===void 0)return z[CZ]=!0,V0(Z(z,G),()=>G);return bZ(_(z,G),(B)=>{return z[CZ]=!0,V0(Z(z,B),()=>G)})},onFailure:(G)=>bZ(R5(G),([K,z])=>{let _=nY();p5(_,z);let B=zY(_.context,M),V=U0.get(B.source),D=z.reasons.length===0?F(K):eZ(z);if(V===void 0)return B[CZ]=!0,bZ(Z(B,K),()=>D);return bZ(bZ(V(B,K),(A)=>{return B[CZ]=!0,Z(B,A)}),()=>D)})}),X=$===void 0?i5(Q):jZ(i5($(Q)),{onFailure(G){let K=nY();p5(K,G);let z=zY(K.context,M);if(CZ in z)return e;return $J(R5(G),{onFailure(_){return Z(z,t({status:500}))},onSuccess([_]){return Z(z,_)}})},onSuccess(G){let K=nY(),z=zY(K.context,M);return CZ in z?e:Z(z,G)}});return JJ(s4(X))},CZ=Symbol.for("effect/http/HttpEffect/handled"),o4=(Y)=>{Y[GJ]=!0},r4=(Y)=>{if(Y.body._tag!=="Stream")return Y;let Z=nY(),$=zY(Z.context,L0);return o4($),M8(Y,jY(XJ(Y.body.stream,(J)=>z0($,J)),Y.body.contentType,Y.body.contentLength))},GJ=Symbol.for("effect/http/HttpEffect/scopeEjected"),s4=(Y)=>u((Z)=>{let $=a5(),J=Z.context;return Z.setContext(gZ(Z.context,L0,$)),w1(Y,(Q)=>{if(Z.setContext(J),GJ in $)return;return YJ($,Q)},!0)}),z9=(Y)=>M.use((Z)=>{return M1(Z,Y),e});var t4=(Y)=>(Z,$)=>{let J=Symbol.for("@effect/platform/HttpApp/resolve"),Q=a4(Z,(X,G)=>{return G=r4(G),X[J](T8(G,{withoutBody:X.method==="HEAD",context:Y})),e},$);return(X,G)=>new Promise((K)=>{let z=new Map(Y.mapUnsafe);if(e$(G))for(let[V,D]of G.mapUnsafe)z.set(V,D);let _=f5(X);z.set(M.key,_),_[J]=K;let B=QJ(bY(z))(Q);X.signal?.addEventListener("abort",()=>{B.interruptUnsafe(void 0,_1.annotation)},{once:!0})})};var KJ=(Y,Z)=>{let $=a5(),J=()=>n5(z0($,O1)),Q,X;function G(K,z){if(Q)return Q(K,z);return X??=n5(i(function*(){let _=yield*Z.memoMap?H1(Y,Z.memoMap,$):ZJ(Y,$);return Q=t4(_)(yield*Z.toHandler(_),Z.middleware)})),X.then((_)=>_(K,z))}return{dispose:J,handler:G}};var t5={};kY(t5,{withLogAddress:()=>s5,serveEffect:()=>X2,serve:()=>P1,makeTestClient:()=>FJ,make:()=>Q2,logAddress:()=>UJ,layerTestClient:()=>G2,layerServices:()=>K2,formatAddress:()=>WJ,addressFormattedWith:()=>AJ,HttpServer:()=>qZ});var o5=(Y)=>{switch(Y._tag){case"Weak":return`W/"${Y.value}"`;case"Strong":return`"${Y.value}"`}};class E1 extends S()("effect/http/Etag/Generator"){}var Y2=(Y)=>{let Z=BY(Y.mtime,{onNone:()=>"0",onSome:($)=>$.getTime().toString(16)});return`${Y.size.toString(16)}-${Z}`},Z2=(Y)=>{return`${Y.size.toString(16)}-${Y.lastModified.toString(16)}`};var I1=M0(E1)({fromFileInfo(Y){return WY(()=>({_tag:"Weak",value:Y2(Y)}))},fromFileWeb(Y){return WY(()=>({_tag:"Weak",value:Z2(Y)}))}});class r5 extends S()("effect/http/HttpPlatform"){}var $2=_0(function*(Y){let Z=yield*dY,$=yield*E1;return r5.of({fileResponse:_0(function*(J,Q){let X=yield*Z.stat(J),G=yield*$.fromFileInfo(X),K=Number(Q?.offset??0),z=Q?.bytesToRead!==void 0?K+Number(Q.bytesToRead):void 0,_=HY(Q?.headers?C(Q.headers):n,"etag",o5(G));if(r(X.mtime))_["last-modified"]=X.mtime.value.toUTCString();let B=z!==void 0?z-K:Number(X.size)-K;return Y.fileResponse(J,Q?.status??200,Q?.statusText,_,K,z,B)}),fileWebResponse(J,Q){return L($.fromFileWeb(J),(X)=>{let G=fZ(Q?.headers?C(Q.headers):n,wY({etag:o5(X),"last-modified":new Date(J.lastModified).toUTCString()}));return Y.fileWebResponse(J,Q?.status??200,Q?.statusText,G,Q)})}})}),zJ=pY(r5)(U(dY.asEffect(),(Y)=>$2({fileResponse(Z,$,J,Q,X,G,K){return j5(Y.stream(Z,{offset:X,bytesToRead:G!==void 0?G-X:void 0}),{contentLength:K,headers:Q,status:$,statusText:J})},fileWebResponse(Z,$,J,Q,X){return j5(SY({evaluate:()=>Z.stream(),onError:BZ}),{headers:Q,status:$,statusText:J})}}))).pipe(rY(I1));class qZ extends S()("effect/http/HttpServer"){}var Q2=(Y)=>Y,P1=O((Y)=>FY(Y[0]),(Y,Z)=>DZ(qZ.use(($)=>$.serve(Y,Z)))),X2=O((Y)=>FY(Y[0]),(Y,Z)=>qZ.use(($)=>$.serve(Y,Z))),WJ=(Y)=>{switch(Y._tag){case"UnixAddress":return`unix://${Y.path}`;case"TcpAddress":return`http://${Y.hostname}:${Y.port}`}},AJ=(Y)=>U(qZ.asEffect(),(Z)=>Y(WJ(Z.address))),UJ=AJ((Y)=>F0(`Listening on ${Y}`)),s5=(Y)=>DZ(UJ).pipe(sY(Y)),FJ=i(function*(){let Y=yield*qZ,Z=yield*vZ,$=Y.address;if($._tag==="UnixAddress")return yield*BJ(Error("HttpServer.layerTestClient: UnixAddress not supported"));let Q=`http://${$.hostname==="0.0.0.0"?"127.0.0.1":$.hostname}:${$.port}`;return F5(Z,a1(Q))}),G2=pY(vZ)(FJ),K2=_J(zJ,DJ,I1).pipe(sY(OJ({})));var NJ="~effect/http/HttpRouter",LY=S("effect/http/HttpRouter"),vJ=i(function*(){let Y=N8(yield*v1),Z=new Set,$=(J)=>ZY((Q)=>{let X=bJ(Q),G=(K)=>{for(let z=0;z<X.length;z++)K=X[z](K);return K};for(let K=0;K<J.length;K++){let z=X.length===0?J[K]:j1({...J[K],handler:G(J[K].handler)});if(z.method==="*")if(z.path.endsWith("/*"))Y.all(z.path,z),Y.all(z.path.slice(0,-2),z);else Y.all(z.path,z);else if(z.path.endsWith("/*"))Y.on(z.method,z.path,z),Y.on(z.method,z.path.slice(0,-2),z);else Y.on(z.method,z.path,z)}return e});return LY.of({[NJ]:NJ,prefixed(J){return LY.of({...this,prefixed:(Q)=>this.prefixed(T0(J,Q)),addAll:(Q)=>$(Q.map(CJ(J))),add:(Q,X,G,K)=>$([j1({method:Q,path:T0(X,J),handler:AY(G)?F(G):FY(G)?G:U(M.asEffect(),G),uninterruptible:K?.uninterruptible??!1,prefix:J})])})},addAll:$,add:(J,Q,X,G)=>$([gJ(J,Q,X,G)]),addGlobalMiddleware:(J)=>WY(()=>{Z.add(J)}),asHttpEffect(){let J=u((Q)=>{let X=new Map(Q.context.mapUnsafe),G=X.get(M.key),K=Y.find(G.method,G.url);if(K===void 0&&G.method==="HEAD")K=Y.find("GET",G.url);if(K===void 0)return g(new l({reason:new v5({request:G})}));let z=K.handler;if(r(z.prefix))X.set(M.key,V2(G,z.prefix.value));X.set(xY.key,K.searchParams),X.set(WZ.key,{route:z,params:K.params});let _=X.get(T1.key);if(_&&_._tag==="Span")_.attribute("http.route",z.path);return J6(z.uninterruptible?z.handler:jJ(z.handler),bY(X))});if(Z.size===0)return J;for(let Q of wJ(Z))J=Q(J);return J}})});function V2(Y,Z){let $=Z.length;return Y.modify({url:Y.url.length<=$?"/":Y.url.slice($)})}var v1=j("effect/http/HttpRouter/RouterConfig",{defaultValue:()=>({})});class WZ extends S()("effect/http/HttpRouter/RouteContext"){}var RJ=L(WZ.asEffect(),(Y)=>Y.params),z2=(Y,Z)=>{let $=f(Y);return ZY((J)=>{let Q=y(J,M),X=y(J,xY),G=y(J,WZ);return U(Q.json,(K)=>$({method:Q.method,url:Q.url,headers:Q.headers,cookies:Q.cookies,pathParams:G.params,searchParams:X,body:K},Z))})},_2=(Y,Z)=>{let $=f(Y);return ZY((J)=>{let Q=y(J,M),X=y(J,xY),G=y(J,WZ);return $({method:Q.method,url:Q.url,headers:Q.headers,cookies:Q.cookies,pathParams:G.params,searchParams:X},Z)})},B2=(Y,Z)=>{let $=f(Y);return ZY((J)=>{let Q=y(J,xY),X=y(J,WZ);return $({...Q,...X.params},Z)})},O2=(Y,Z)=>{let $=f(Y);return U(RJ,(J)=>$(J,Z))},SJ=(Y)=>DZ(U(LY.asEffect(),Y)),D2=(Y,Z,$,J)=>SJ((Q)=>Q.add(Y,Z,$,J)),W2=(Y,Z)=>DZ(i(function*(){let $=FY(Y)?yield*Y:Y,J=yield*LY;if(Z?.prefix)J=J.prefixed(Z.prefix);yield*J.addAll($)})),xZ=pY(LY)(vJ),A2=(Y)=>i(function*(){let Z=yield*Z6(sY(Y,xZ));return y(Z,LY).asHttpEffect()}),LJ="~effect/http/HttpRouter/Route",j1=(Y)=>({...Y,uninterruptible:Y.uninterruptible??!1,prefix:typeof Y.prefix==="string"?b(Y.prefix):Y.prefix??H(),[LJ]:LJ}),gJ=(Y,Z,$,J)=>j1({...J,method:Y,path:Z,handler:AY($)?F($):FY($)?$:U(M.asEffect(),$),uninterruptible:J?.uninterruptible??!1}),U2=(Y)=>Y.endsWith("/")?Y.slice(0,-1):Y,T0=O(2,(Y,Z)=>{if(Z=U2(Z),Y==="*")return`${Z}/*`;else if(Y==="/")return Z;return Z+Y}),CJ=O(2,(Y,Z)=>j1({...Y,path:T0(Y.path,Z),prefix:BY(Y.prefix,{onNone:()=>Z,onSome:($)=>T0($,Z)})})),F2="~effect/http/HttpRouter/Middleware",R1=function(){if(arguments.length===0)return MJ;return MJ(arguments[0],arguments[1])},MJ=(Y,Z)=>Z?.global?DZ(i(function*(){let $=yield*LY,J=FY(Y)?yield*Y:Y;yield*$.addGlobalMiddleware(J)})):new Q6(FY(Y)?$6(L(Y,($)=>bY(new Map([[e5,$]])))):IJ(bY(new Map([[e5,Y]])))),N2=0,e5="effect/http/HttpRouter/MiddlewareFn";class Q6{[F2]={};layerFn;dependencies;constructor(Y,Z){this.layerFn=Y,this.dependencies=Z;let $=`effect/http/HttpRouter/Middleware-${++N2}`;this.layer=$6(i({self:this},function*(){let J=yield*E5(),Q=[J.mapUnsafe.get(e5)];if(this.dependencies){let X=yield*EJ,G=y(J,L0),K=yield*H1(this.dependencies,X,G);Q.push(...bJ(K))}return bY(new Map([[$,Q]]))})).pipe(rY(this.layerFn))}layer;combine(Y){return new Q6(this.layerFn,this.dependencies?sY(this.dependencies,Y.layer):Y.layer)}}var TJ=new WeakMap,bJ=(Y)=>{let Z=TJ.get(Y);if(Z)return Z;let $=HJ(),J=0;for(let[Q,X]of Y.mapUnsafe)if(Q.startsWith("effect/http/HttpRouter/Middleware-")){if($.push(X),X.length>J)J=X.length}if($.length===0)Z=[];else{let Q=new Set;for(let X=J-1;X>=0;X--)for(let G of $)if(X<G.length)Q.add(G[X]);Z=y0(Q).reverse()}return TJ.set(Y,Z),Z},L2=(Y)=>R1(t$(Y),{global:!0}),M2=R1(s$).layer,T2=(Y)=>(Z)=>rY(Z,R1()(i(function*(){let $=yield*Z6(Y);return(J)=>J6(J,$)})).layer),w2=(Y,Z)=>{let $=Z?.middleware;if(Z?.disableLogger!==!0)$=$?Y6($,N0):N0;let J=Z?.routerConfig?rY(xZ,M0(v1)(Z.routerConfig)):xZ;return i(function*(){let X=(yield*LY).asHttpEffect();return $?P1(X,$):P1(X)}).pipe(PJ,sY(Y),rY(J),Z?.disableListenLog?BZ:s5)},H2=(Y,Z)=>{let $=Z?.middleware;if(Z?.disableLogger!==!0)$=$?Y6($,N0):N0;let J=Z?.routerConfig?rY(xZ,M0(v1)(Z.routerConfig)):xZ;return KJ(sY(Y,J),{toHandler:(Q)=>F(y(Q,LY).asHttpEffect()),middleware:$,memoMap:Z?.memoMap})};export{C as ps,wY as qs,fZ as rs,P0 as ss,mZ as ts,nJ as us,lZ as vs,c0 as ws,TZ as xs,eJ as ys,$Y as zs,pZ as As,e0 as Bs,vZ as Cs,s as Ds,XX as Es,BX as Fs,e7 as Gs,G1 as Hs,X8 as Is,AY as Js,t as Ks,N3 as Ls,L3 as Ms,M3 as Ns,T3 as Os,w3 as Ps,H3 as Qs,oY as Rs,c3 as Ss,M as Ts,xY as Us,I4 as Vs,P4 as Ws,j4 as Xs,A0 as Ys,z9 as Zs,t5 as _s,WZ as $s,SJ as at,gJ as bt,T0 as ct,qJ as dt};
|
|
4
|
+
--${B}`,function(N,T){if(N===0){D();return}else if(N!==V.index){if(V.index>0)if(V.isFile)V.onChunk(null),V.partSize=0;else{if(V.fieldChunks.length===1)$(V.info,V.fieldChunks[0]);else{let E=new Uint8Array(V.fieldSize),YY=0;for(let I=0;I<V.fieldChunks.length;I++){let p=V.fieldChunks[I];E.set(p,YY),YY+=p.length}$(V.info,E)}V.fieldSize=0,V.fieldChunks=[]}if(V.state=CY.headers,V.index=N,V.headerSkip=2,T[0]===45&&T[1]===45)return Q();if(V.parts++,V.parts>G)J(B4)}if((V.partSize+=T.length)>z)J(D4);if(V.state===CY.headers){let E=A(T,V.headerSkip);if(V.headerSkip=0,E._tag==="Continue")return;else if(E._tag==="Failure")return D(),J({_tag:"BadHeaders",error:E});let YY=A1(E.headers["content-type"]),I=A1(E.headers["content-disposition"],!0);if(I.value==="form-data"&&!("name"in I.parameters))return D(),J(z4);let p;if("filename*"in I.parameters){let w=I.parameters["filename*"].split("''");if(w.length===2)p=decodeURIComponent(w[1])}if(V.info={name:I.parameters.name??"",filename:p??I.parameters.filename,contentType:YY.value===""?I.parameters.filename!==void 0?"application/octet-stream":"text/plain":YY.value,contentTypeParameters:YY.parameters,contentDisposition:I.value,contentDispositionParameters:I.parameters,headers:E.headers},V.state=CY.body,V.isFile=X(V.info),V.isFile)V.onChunk=Z(V.info);if(E.endPosition<T.length)if(V.isFile)V.onChunk(T.subarray(E.endPosition));else{let w=T.subarray(E.endPosition);if((V.fieldSize+=w.length)>_)J(K$);V.fieldChunks.push(w)}}else if(V.isFile)V.onChunk(T);else{if((V.fieldSize+=T.length)>_)J(K$);V.fieldChunks.push(T)}},W4);return{write(N){if((V.totalSize+=N.length)>K)return J(O4);return W.write(N)},end(){if(W.end(),V.state===CY.body)J(_4);V.state=CY.headers,V.index=0,V.parts=0,V.onChunk=U1,V.info=void 0,V.totalSize=0,V.partSize=0,V.fieldChunks=[],V.fieldSize=0}}}var V$=new TextDecoder("utf-8");function U4(Y){if(Y==="utf-8"||Y==="utf8"||Y==="")return V$;try{return new TextDecoder(Y)}catch(Z){return V$}}function _$(Y,Z){return U4(Y.contentTypeParameters.charset??"utf-8").decode(Z)}var B$=z$,O$=b5,D$=_$;var NY="~effect/http/Multipart";var W$="~effect/http/Multipart/MultipartError";class j$ extends n0{}class k extends P("MultipartError"){static fromReason(Y,Z){return new k({reason:new j$({_tag:Y,cause:Z})})}[W$]=W$;get message(){return this.reason._tag}}var y5=(Y)=>f(Y),v$=(Y,Z)=>{let $=P$(Y);return O(2,(J,Q)=>L(f(I$({[Q]:$}))(J,Z),(X)=>X[Q]))},L4=(Y)=>u((Z)=>{let $=y(Z.context,x$);return F({headers:Y,maxParts:Z.getRef(C$),maxFieldSize:Number(Z.getRef(b$)),maxPartSize:D0(Z.getRef(q$),Number),maxTotalSize:D0(Z.getRef(rZ),Number),isFile:$.length===0?void 0:(J)=>!$.some((Q)=>J.contentType.includes(Q))&&O$(J)})}),k5=(Y)=>D1((Z)=>L(L4(Y),($)=>{let J=[],Q=H(),X=B$({...$,onField(K,z){J.push(new R$(K.name,K.contentType,D$(K,z)))},onFile(K){let z=[],_=!1,B=L$(F(_Z(function V(){if(!q5(z))return _?U$():U(G,V);let D=z;return z=[],F(D)})));return J.push(new S$(K,B)),function(V){if(V===null)_=!0;else z.push(V)}},onError(K){Q=b(x5(M4(K)))},onDone(){Q=b(x5(A$()))}}),G=Z.pipe(U((K)=>{for(let z=0;z<K.length;z++)X.write(K[z]);return e}),K0((K)=>{if(N$(K))X.end();else Q=b(F$(K));return e}));return G.pipe(U(function K(){if(!q5(J)){if(r(Q))return Q.value;return U(G,K)}let z=J;return J=[],F(z)}))}));function M4(Y){switch(Y._tag){case"ReachedLimit":switch(Y.limit){case"MaxParts":return k.fromReason("TooManyParts",Y);case"MaxFieldSize":return k.fromReason("FieldTooLarge",Y);case"MaxPartSize":return k.fromReason("FileTooLarge",Y);case"MaxTotalSize":return k.fromReason("BodyTooLarge",Y)}default:return k.fromReason("Parse",Y)}}class F1 extends RY{[NY];constructor(){super();this[NY]=NY}}class R$ extends F1{_tag="Field";key;contentType;value;constructor(Y,Z,$){super();this.key=Y,this.contentType=Z,this.value=$}toJSON(){return{_id:"@effect/platform/Multipart/Part",_tag:"Field",key:this.key,contentType:this.contentType,value:this.value}}}class S$ extends F1{_tag="File";key;name;contentType;content;contentEffect;constructor(Y,Z){super();this.key=Y.name,this.name=Y.filename??Y.name,this.contentType=Y.contentType,this.content=T$(Z),this.contentEffect=Z.pipe(w4,JZ(($)=>k.fromReason("InternalError",$)))}toJSON(){return{_id:"@effect/platform/Multipart/Part",_tag:"File",key:this.key,name:this.name,contentType:this.contentType}}}var T4=(Y,Z)=>U(dY.asEffect(),($)=>JZ(w$(Z.content,$.sink(Y)),(J)=>k.fromReason("InternalError",J))),w4=(Y)=>M$(Y,DY(new Uint8Array(0)),(Z,$)=>{let J=$.reduce((G,K)=>G+K.length,Z.length),Q=new Uint8Array(J);Q.set(Z,0);let X=Z.length;for(let G of $)Q.set(G,X),X+=G.length;return Q}),m5=(Y,Z=T4)=>i(function*(){let $=yield*dY,J=yield*E$,Q=yield*$.makeTempDirectoryScoped(),X=Object.create(null);return yield*H$(Y,(G)=>{if(G._tag==="Field"){if(!(G.key in X))X[G.key]=G.value;else if(typeof X[G.key]==="string")X[G.key]=[X[G.key],G.value];else X[G.key].push(G.value);return e}else if(G.name==="")return e;let K=G,z=J.join(Q,J.basename(K.name).slice(-128)),_=new g$(K.key,K.name,K.contentType,z);if(Array.isArray(X[G.key]))X[G.key].push(_);else X[G.key]=[_];return Z(z,K)}),X}).pipe(X1("PlatformError",($)=>g(k.fromReason("InternalError",$))));class g$ extends F1{_tag="PersistedFile";key;name;contentType;path;constructor(Y,Z,$,J){super();this.key=Y,this.name=Z,this.contentType=$,this.path=J}toJSON(){return{_id:"@effect/platform/Multipart/Part",_tag:"PersistedFile",key:this.key,name:this.name,contentType:this.contentType,path:this.path}}}var c3=(Y)=>{let Z=new Map;if(Y.maxParts!==void 0)Z.set(C$.key,Y.maxParts);if(Y.maxFieldSize!==void 0)Z.set(b$.key,O0(Y.maxFieldSize));if(Y.maxFileSize!==void 0)Z.set(q$.key,D0(Y.maxFileSize,O0));if(Y.maxTotalSize!==void 0)Z.set(rZ.key,D0(Y.maxTotalSize,O0));if(Y.fieldMimeTypes!==void 0)Z.set(x$.key,Y.fieldMimeTypes);return bY(Z)},C$=j("effect/http/Multipart/MaxParts",{defaultValue:()=>{return}}),b$=j("effect/http/Multipart/MaxFieldSize",{defaultValue:DY(O0(10485760))}),q$=j("effect/http/Multipart/MaxFileSize",{defaultValue:()=>{return}}),x$=j("effect/http/Multipart/FieldMimeTypes",{defaultValue:DY(["application/json"])});var OZ="~effect/http/HttpServerRequest",M=S("effect/http/HttpServerRequest");class xY extends S()("effect/http/ParsedSearchParams"){}var m$=(Y)=>{let Z={};for(let[$,J]of Y.searchParams.entries()){let Q=Z[$];if(Q!==void 0)if(Array.isArray(Q))Q.push(J);else Z[$]=[Q,J];else Z[$]=J}return Z},E4=()=>M.asEffect().pipe(U((Y)=>Y.upgrade),L($$()),C5),I4=(Y,Z)=>{let $=f(Y);return U(M.asEffect(),(J)=>$(J.cookies,Z))},P4=(Y,Z)=>{let $=f(Y);return U(M.asEffect(),(J)=>$(J.headers,Z))},j4=(Y,Z)=>{let $=f(Y);return U(xY.asEffect(),(J)=>$(J,Z))},v4=(Y,Z)=>{let $=s0(Y,Z);return U(M.asEffect(),$)},h$=(Y)=>Y.headers["content-type"]?.toLowerCase().includes("multipart/form-data")===!0||k4(Y)!==void 0,R4=(Y,Z)=>{let $=y5(Y),J=oZ(Y,Z);return U(M.asEffect(),(Q)=>{if(h$(Q))return U(Q.multipart,(X)=>$(X,Z));return J(Q)})},S4=(Y,Z)=>{let $=oZ(Y,Z);return U(M.asEffect(),$)},g4=(Y,Z)=>{let $=y5(Y);return M.asEffect().pipe(U((J)=>J.multipart),U((J)=>$(J,Z)))},C4=(Y,Z)=>{let $=v$(Y,Z);return(J)=>{let Q=b6(J).pipe(cY(Y),iY);return U(M.asEffect(),(X)=>{if(h$(X))return U(JZ(X.multipart,(G)=>new l({reason:new JY({request:X,cause:G})})),$(J));return U(X.urlParamsBody,(G)=>Q(G,Z))})}},b4=(Y)=>{let Z=BY(o1(Y),{onNone:()=>Y.url,onSome:($)=>$.toString()});return new d5(Y,Z)},f5=(Y)=>new c5(Y,f$(Y.url)),q4=(Y)=>EZ(R(Y.method,"",m0,H(),Y.headers,x4(Y)),L1(W0(Y),()=>Y.url)),x4=(Y)=>TZ(Y.method)?jY(Y.stream,Y.headers["content-type"],y4(Y.headers["content-length"])):QZ,y4=(Y)=>{if(Y===void 0)return;let Z=Number.parseInt(Y,10);return Number.isNaN(Z)?void 0:Z},f$=(Y)=>{if(Y[0]==="/")return Y;let Z=Y.indexOf("/",Y.indexOf("//")+2);return Z===-1?"/":Y.slice(Z)};class c5 extends RY{[OZ];[c];source;url;headersOverride;remoteAddressOverride;constructor(Y,Z,$,J){super();this[OZ]=OZ,this[c]=c,this.source=Y,this.url=Z,this.headersOverride=$,this.remoteAddressOverride=J}toJSON(){return sZ(this,{_id:"HttpServerRequest",method:this.method,url:this.originalUrl})}modify(Y){return new c5(this.source,Y.url??this.url,Y.headers??this.headersOverride,"remoteAddress"in Y?Y.remoteAddress:this.remoteAddressOverride)}get method(){return this.source.method.toUpperCase()}get originalUrl(){return this.source.url}get remoteAddress(){return this.remoteAddressOverride??H()}get headers(){return this.headersOverride??=C(this.source.headers),this.headersOverride}cachedCookies;get cookies(){if(this.cachedCookies)return this.cachedCookies;return this.cachedCookies=Z5(this.headers.cookie??"")}get stream(){return this.source.body?SY({evaluate:()=>this.source.body,onError:(Y)=>new l({reason:new JY({request:this,cause:Y})})}):tZ(new l({reason:new JY({request:this,description:"can not create stream from empty body"})}))}textEffect;get text(){if(this.textEffect)return this.textEffect;return this.textEffect=o(OY(d({try:()=>this.source.text(),catch:(Y)=>new l({reason:new JY({request:this,cause:Y})})}))),this.textEffect}get json(){return U(this.text,(Y)=>GY({try:()=>JSON.parse(Y),catch:(Z)=>new l({reason:new JY({request:this,cause:Z})})}))}get urlParamsBody(){return U(this.text,(Y)=>GY({try:()=>a(new URLSearchParams(Y)),catch:(Z)=>new l({reason:new JY({request:this,cause:Z})})}))}multipartEffect;get multipart(){if(this.multipartEffect)return this.multipartEffect;return this.multipartEffect=o(OY(m5(this.multipartStream))),this.multipartEffect}get multipartStream(){return h5(X0(this.stream,(Y)=>k.fromReason("InternalError",Y)),k5(this.headers))}arrayBufferEffect;get arrayBuffer(){if(this.arrayBufferEffect)return this.arrayBufferEffect;return this.arrayBufferEffect=o(OY(d({try:()=>this.source.arrayBuffer(),catch:(Y)=>new l({reason:new JY({request:this,cause:Y})})}))),this.arrayBufferEffect}get upgrade(){return g(new l({reason:new JY({request:this,description:"Not an upgradeable ServerRequest"})}))}}class d5 extends RY{[OZ];[c];source;originalUrl;headersOverride;remoteAddressOverride;urlOverride;constructor(Y,Z,$,J,Q){super();this[OZ]=OZ,this[c]=c,this.source=Y,this.originalUrl=Z,this.urlOverride=$,this.headersOverride=J,this.remoteAddressOverride=Q}toJSON(){return sZ(this,{_id:"HttpServerRequest",method:this.method,url:this.originalUrl})}modify(Y){return new d5(this.source,this.originalUrl,Y.url??this.url,Y.headers??this.headersOverride,"remoteAddress"in Y?Y.remoteAddress:this.remoteAddressOverride)}get method(){return this.source.method}get url(){return this.urlOverride??f$(this.originalUrl)}get remoteAddress(){return this.remoteAddressOverride??H()}get headers(){return this.headersOverride??=this.source.headers}cachedCookies;get cookies(){if(this.cachedCookies)return this.cachedCookies;return this.cachedCookies=Z5(this.headers.cookie??"")}get stream(){let Y=this.source.body;switch(Y._tag){case"Empty":return K1;case"Uint8Array":return I5(Y.body);case"Stream":return X0(Y.stream,(Z)=>qY(this,void 0,Z));case"FormData":return N1(this,new Response(Y.formData).body);case"Raw":return m4(this,Y.body)}}bytesEffect;get bytes(){if(this.bytesEffect)return this.bytesEffect;let Y=this.source.body,Z;switch(Y._tag){case"Empty":{Z=F(new Uint8Array(0));break}case"Uint8Array":{Z=F(Y.body);break}case"FormData":{Z=c$(this,Y.formData);break}case"Stream":{Z=P5(this.stream);break}case"Raw":{Z=h4(this,Y.body);break}}return this.bytesEffect=o(OY(Z)),this.bytesEffect}get text(){return L(this.bytes,(Y)=>d4.decode(Y))}get json(){return U(this.text,(Y)=>GY({try:()=>Y===""?null:JSON.parse(Y),catch:(Z)=>qY(this,void 0,Z)}))}get urlParamsBody(){return U(this.text,(Y)=>GY({try:()=>a(new URLSearchParams(Y)),catch:(Z)=>qY(this,void 0,Z)}))}multipartEffect;get multipart(){if(this.multipartEffect)return this.multipartEffect;return this.multipartEffect=o(OY(m5(this.multipartStream))),this.multipartEffect}get multipartStream(){let Y=this.source.body._tag==="FormData"&&this.source.body.formData;if(Y)return k$(f4(Y));return h5(X0(this.stream,(Z)=>k.fromReason("InternalError",Z)),k5(this.headers))}get arrayBuffer(){return L(this.bytes,(Y)=>Y.slice().buffer)}get upgrade(){return g(qY(this,"Not an upgradeable ServerRequest"))}}var k4=(Y)=>{if(!KZ(Y.source))return;let Z=Y.source.body;if(Z._tag==="FormData")return Z.formData;if(Z._tag==="Raw"&&l$(Z.body))return Z.body;return},m4=(Y,Z)=>{if(Z instanceof Request)return N1(Y,Z.body);if(l$(Z))return N1(Y,new Response(Z).body);if(c4(Z))return N1(Y,Z);return tZ(qY(Y,"Unsupported body type"))},h4=(Y,Z)=>{if(Z instanceof Blob)return c$(Y,Z);if(Z instanceof Request)return d({try:()=>Z.arrayBuffer().then(($)=>new Uint8Array($)),catch:($)=>qY(Y,void 0,$)});return g(qY(Y,"Unsupported body type"))},c$=(Y,Z)=>d({try:()=>new Response(Z).arrayBuffer().then(($)=>new Uint8Array($)),catch:($)=>qY(Y,void 0,$)}),N1=(Y,Z)=>Z?SY({evaluate:()=>Z,onError:($)=>qY(Y,void 0,$)}):K1,qY=(Y,Z,$)=>new l({reason:new JY({request:Y,...Z===void 0?void 0:{description:Z},...$===void 0?void 0:{cause:$}})}),f4=(Y)=>{let Z=[];for(let[$,J]of Y.entries())Z.push(typeof J==="string"?new d$($,J):new u$($,J));return Z};class d$ extends RY{[NY];_tag="Field";contentType="text/plain";key;value;constructor(Y,Z){super();this[NY]=NY,this.key=Y,this.value=Z}toJSON(){return{_id:"@effect/platform/Multipart/Part",_tag:"Field",key:this.key,contentType:this.contentType,value:this.value}}}class u$ extends RY{[NY];_tag="File";key;name;contentType;content;contentEffect;constructor(Y,Z){super();this[NY]=NY,this.key=Y,this.name=Z.name,this.contentType=Z.type,this.content=SY({evaluate:()=>Z.stream(),onError:($)=>k.fromReason("InternalError",$)}),this.contentEffect=d({try:()=>Z.arrayBuffer().then(($)=>new Uint8Array($)),catch:($)=>k.fromReason("InternalError",$)})}toJSON(){return{_id:"@effect/platform/Multipart/Part",_tag:"File",key:this.key,name:this.name,contentType:this.contentType}}}var c4=(Y)=>typeof ReadableStream<"u"&&Y instanceof ReadableStream,l$=(Y)=>typeof FormData<"u"&&Y instanceof FormData,d4=new TextDecoder,W0=(Y)=>{let Z=Y.headers.host??"localhost",$=Y.headers["x-forwarded-proto"]==="https"?"https":"http";try{return b(new URL(Y.url,`${$}://${Z}`))}catch{return H()}},u5=(Y,Z)=>{if(Y.source instanceof Request)return PY(Y.source);let $=W0(Y);if(y$($))return h(new JY({request:Y,description:"Invalid URL"}));let J={method:Y.method,headers:Y.headers};if(Z?.signal)J.signal=Z.signal;if(TZ(Y.method))J.body=wZ(Y.stream,Z?.context??GZ()),J.duplex="half";return PY(new Request($.value,J))},u4=(Y,Z)=>ZY(($)=>u5(Y,{context:$,signal:Z?.signal}).asEffect());var U0=new WeakMap,M1=(Y,Z)=>{let $=U0.get(Y.source),J=$?(Q,X)=>U($(Q,X),(G)=>Z(Q,G)):Z;U0.set(Y.source,J)};var o$=(Y)=>Y,r$=new WeakSet,l4=(Y)=>{let Z=Y.indexOf("?"),$=Y.indexOf("#");if(Z===-1)return $===-1?Y:Y.slice(0,$);if($===-1)return Y.slice(0,Z);return Y.slice(0,Math.min(Z,$))},s$=(Y)=>u((Z)=>{let $=zY(Z.context,M);return r$.add($.source),Y}),i4=j("effect/http/HttpMiddleware/TracerDisabledWhen",{defaultValue:()=>$1});var p4=j("@effect/platform/HttpMiddleware/SpanNameGenerator",{defaultValue:()=>(Y)=>`http.server ${Y.method}`}),N0=o$((Y)=>{let Z=0;return u(($)=>{let J=zY($.context,M),Q=l4(J.url);return a$(U(n$(Y),(X)=>{if(r$.has(J.source))return X;else if(X._tag==="Failure"){let[G,K]=S5(X.cause);return $0(l5(F0(L1(K,()=>"Sent HTTP Response")),{"http.method":J.method,"http.url":Q,"http.status":G.status}),X)}return $0(l5(F0("Sent HTTP response"),{"http.method":J.method,"http.url":Q,"http.status":X.value.status}),X)}),`http.span.${++Z}`)})}),i5=o$((Y)=>u((Z)=>{let $=zY(Z.context,M);if(!Z.getRef(p$)||Z.getRef(i4)($))return Y;let Q=Z.getRef(p4),X=i$(Z,Q($),{parent:XZ(w7($.headers)),kind:"server"}),G=Z.context;return Z.setContext(gZ(Z.context,T1,X)),w1(Y,(K)=>{Z.setContext(G);let z=Z.getRef(J1).currentTimeNanosUnsafe();Z.currentDispatcher.scheduleTask(()=>{let _=W0($);if(r(_)&&(_.value.username!==""||_.value.password!==""))_.value.username="REDACTED",_.value.password="REDACTED";let B=Z.getRef(cZ),V=YZ($.headers,B);if(X.attribute("http.request.method",$.method),r(_)){if(X.attribute("url.full",_.value.toString()),X.attribute("url.path",_.value.pathname),_.value.search.slice(1)!=="")X.attribute("url.query",_.value.search.slice(1));X.attribute("url.scheme",_.value.protocol.slice(0,-1))}if($.headers["user-agent"]!==void 0)X.attribute("user_agent.original",$.headers["user-agent"]);for(let W in V)X.attribute(`http.request.header.${W}`,String(V[W]));if(r($.remoteAddress))X.attribute("client.address",$.remoteAddress.value);let D=C8(K);X.attribute("http.response.status_code",D.status);let A=YZ(D.headers,B);for(let W in A)X.attribute(`http.response.header.${W}`,String(A[W]));X.end(z,K)},0);return},!0)}));var t$=(Y)=>{let Z={allowedOrigins:Y?.allowedOrigins??[],allowedMethods:Y?.allowedMethods??["GET","HEAD","PUT","PATCH","POST","DELETE"],allowedHeaders:Y?.allowedHeaders??[],exposedHeaders:Y?.exposedHeaders??[],credentials:Y?.credentials??!1,maxAge:Y?.maxAge},$=typeof Z.allowedOrigins==="function"?Z.allowedOrigins:(D)=>Z.allowedOrigins.includes(D),J=typeof Z.allowedOrigins==="function"||Z.allowedOrigins.length>1?(D)=>{if(!$(D))return;return{"access-control-allow-origin":D,vary:"Origin"}}:Z.allowedOrigins.length===0?DY({"access-control-allow-origin":"*"}):DY({"access-control-allow-origin":Z.allowedOrigins[0],vary:"Origin"}),Q=Z.allowedMethods.length>0?{"access-control-allow-methods":Z.allowedMethods.join(", ")}:void 0,X=Z.credentials?{"access-control-allow-credentials":"true"}:void 0,G=(D)=>{if(Z.allowedHeaders.length===0&&D)return{vary:"Access-Control-Request-Headers","access-control-allow-headers":D};if(Z.allowedHeaders)return{"access-control-allow-headers":Z.allowedHeaders.join(",")};return},K=Z.exposedHeaders.length>0?{"access-control-expose-headers":Z.exposedHeaders.join(",")}:void 0,z=Z.maxAge?{"access-control-max-age":Z.maxAge.toString()}:void 0,_=(D)=>{let A=D.headers.origin;return wY({...J(A),...X,...K})},B=(D)=>{let A=D.headers.origin,W=D.headers["access-control-request-headers"];return wY({...J(A),...X,...K,...Q,...G(W),...z})},V=(D,A)=>F(L8(A,_(D)));return(D)=>u((A)=>{let W=zY(A.context,M);if(W.method==="OPTIONS")return F(t({status:204,headers:B(W)}));return M1(W,V),D})};var a4=(Y,Z,$)=>{let Q=jZ(Y,{onSuccess:(G)=>{let K=nY(),z=zY(K.context,M),_=U0.get(z.source);if(_===void 0)return z[CZ]=!0,V0(Z(z,G),()=>G);return bZ(_(z,G),(B)=>{return z[CZ]=!0,V0(Z(z,B),()=>G)})},onFailure:(G)=>bZ(R5(G),([K,z])=>{let _=nY();p5(_,z);let B=zY(_.context,M),V=U0.get(B.source),D=z.reasons.length===0?F(K):eZ(z);if(V===void 0)return B[CZ]=!0,bZ(Z(B,K),()=>D);return bZ(bZ(V(B,K),(A)=>{return B[CZ]=!0,Z(B,A)}),()=>D)})}),X=$===void 0?i5(Q):jZ(i5($(Q)),{onFailure(G){let K=nY();p5(K,G);let z=zY(K.context,M);if(CZ in z)return e;return $J(R5(G),{onFailure(_){return Z(z,t({status:500}))},onSuccess([_]){return Z(z,_)}})},onSuccess(G){let K=nY(),z=zY(K.context,M);return CZ in z?e:Z(z,G)}});return JJ(s4(X))},CZ=Symbol.for("effect/http/HttpEffect/handled"),o4=(Y)=>{Y[GJ]=!0},r4=(Y)=>{if(Y.body._tag!=="Stream")return Y;let Z=nY(),$=zY(Z.context,L0);return o4($),M8(Y,jY(XJ(Y.body.stream,(J)=>z0($,J)),Y.body.contentType,Y.body.contentLength))},GJ=Symbol.for("effect/http/HttpEffect/scopeEjected"),s4=(Y)=>u((Z)=>{let $=a5(),J=Z.context;return Z.setContext(gZ(Z.context,L0,$)),w1(Y,(Q)=>{if(Z.setContext(J),GJ in $)return;return YJ($,Q)},!0)}),z9=(Y)=>M.use((Z)=>{return M1(Z,Y),e});var t4=(Y)=>(Z,$)=>{let J=Symbol.for("@effect/platform/HttpApp/resolve"),Q=a4(Z,(X,G)=>{return G=r4(G),X[J](T8(G,{withoutBody:X.method==="HEAD",context:Y})),e},$);return(X,G)=>new Promise((K)=>{let z=new Map(Y.mapUnsafe);if(e$(G))for(let[V,D]of G.mapUnsafe)z.set(V,D);let _=f5(X);z.set(M.key,_),_[J]=K;let B=QJ(bY(z))(Q);X.signal?.addEventListener("abort",()=>{B.interruptUnsafe(void 0,_1.annotation)},{once:!0})})};var KJ=(Y,Z)=>{let $=a5(),J=()=>n5(z0($,O1)),Q,X;function G(K,z){if(Q)return Q(K,z);return X??=n5(i(function*(){let _=yield*Z.memoMap?H1(Y,Z.memoMap,$):ZJ(Y,$);return Q=t4(_)(yield*Z.toHandler(_),Z.middleware)})),X.then((_)=>_(K,z))}return{dispose:J,handler:G}};var t5={};kY(t5,{withLogAddress:()=>s5,serveEffect:()=>X2,serve:()=>P1,makeTestClient:()=>FJ,make:()=>Q2,logAddress:()=>UJ,layerTestClient:()=>G2,layerServices:()=>K2,formatAddress:()=>WJ,addressFormattedWith:()=>AJ,HttpServer:()=>qZ});var o5=(Y)=>{switch(Y._tag){case"Weak":return`W/"${Y.value}"`;case"Strong":return`"${Y.value}"`}};class E1 extends S()("effect/http/Etag/Generator"){}var Y2=(Y)=>{let Z=BY(Y.mtime,{onNone:()=>"0",onSome:($)=>$.getTime().toString(16)});return`${Y.size.toString(16)}-${Z}`},Z2=(Y)=>{return`${Y.size.toString(16)}-${Y.lastModified.toString(16)}`};var I1=M0(E1)({fromFileInfo(Y){return WY(()=>({_tag:"Weak",value:Y2(Y)}))},fromFileWeb(Y){return WY(()=>({_tag:"Weak",value:Z2(Y)}))}});class r5 extends S()("effect/http/HttpPlatform"){}var $2=_0(function*(Y){let Z=yield*dY,$=yield*E1;return r5.of({fileResponse:_0(function*(J,Q){let X=yield*Z.stat(J),G=yield*$.fromFileInfo(X),K=Number(Q?.offset??0),z=Q?.bytesToRead!==void 0?K+Number(Q.bytesToRead):void 0,_=HY(Q?.headers?C(Q.headers):n,"etag",o5(G));if(r(X.mtime))_["last-modified"]=X.mtime.value.toUTCString();let B=z!==void 0?z-K:Number(X.size)-K;return Y.fileResponse(J,Q?.status??200,Q?.statusText,_,K,z,B)}),fileWebResponse(J,Q){return L($.fromFileWeb(J),(X)=>{let G=fZ(Q?.headers?C(Q.headers):n,wY({etag:o5(X),"last-modified":new Date(J.lastModified).toUTCString()}));return Y.fileWebResponse(J,Q?.status??200,Q?.statusText,G,Q)})}})}),zJ=pY(r5)(U(dY.asEffect(),(Y)=>$2({fileResponse(Z,$,J,Q,X,G,K){return j5(Y.stream(Z,{offset:X,bytesToRead:G!==void 0?G-X:void 0}),{contentLength:K,headers:Q,status:$,statusText:J})},fileWebResponse(Z,$,J,Q,X){return j5(SY({evaluate:()=>Z.stream(),onError:BZ}),{headers:Q,status:$,statusText:J})}}))).pipe(rY(I1));class qZ extends S()("effect/http/HttpServer"){}var Q2=(Y)=>Y,P1=O((Y)=>FY(Y[0]),(Y,Z)=>DZ(qZ.use(($)=>$.serve(Y,Z)))),X2=O((Y)=>FY(Y[0]),(Y,Z)=>qZ.use(($)=>$.serve(Y,Z))),WJ=(Y)=>{switch(Y._tag){case"UnixAddress":return`unix://${Y.path}`;case"TcpAddress":return`http://${Y.hostname}:${Y.port}`}},AJ=(Y)=>U(qZ.asEffect(),(Z)=>Y(WJ(Z.address))),UJ=AJ((Y)=>F0(`Listening on ${Y}`)),s5=(Y)=>DZ(UJ).pipe(sY(Y)),FJ=i(function*(){let Y=yield*qZ,Z=yield*vZ,$=Y.address;if($._tag==="UnixAddress")return yield*BJ(Error("HttpServer.layerTestClient: UnixAddress not supported"));let Q=`http://${$.hostname==="0.0.0.0"?"127.0.0.1":$.hostname}:${$.port}`;return F5(Z,a1(Q))}),G2=pY(vZ)(FJ),K2=_J(zJ,DJ,I1).pipe(sY(OJ({})));var NJ="~effect/http/HttpRouter",LY=S("effect/http/HttpRouter"),vJ=i(function*(){let Y=N8(yield*v1),Z=new Set,$=(J)=>ZY((Q)=>{let X=bJ(Q),G=(K)=>{for(let z=0;z<X.length;z++)K=X[z](K);return K};for(let K=0;K<J.length;K++){let z=X.length===0?J[K]:j1({...J[K],handler:G(J[K].handler)});if(z.method==="*")if(z.path.endsWith("/*"))Y.all(z.path,z),Y.all(z.path.slice(0,-2),z);else Y.all(z.path,z);else if(z.path.endsWith("/*"))Y.on(z.method,z.path,z),Y.on(z.method,z.path.slice(0,-2),z);else Y.on(z.method,z.path,z)}return e});return LY.of({[NJ]:NJ,prefixed(J){return LY.of({...this,prefixed:(Q)=>this.prefixed(T0(J,Q)),addAll:(Q)=>$(Q.map(CJ(J))),add:(Q,X,G,K)=>$([j1({method:Q,path:T0(X,J),handler:AY(G)?F(G):FY(G)?G:U(M.asEffect(),G),uninterruptible:K?.uninterruptible??!1,prefix:J})])})},addAll:$,add:(J,Q,X,G)=>$([gJ(J,Q,X,G)]),addGlobalMiddleware:(J)=>WY(()=>{Z.add(J)}),asHttpEffect(){let J=u((Q)=>{let X=new Map(Q.context.mapUnsafe),G=X.get(M.key),K=Y.find(G.method,G.url);if(K===void 0&&G.method==="HEAD")K=Y.find("GET",G.url);if(K===void 0)return g(new l({reason:new v5({request:G})}));let z=K.handler;if(r(z.prefix))X.set(M.key,V2(G,z.prefix.value));X.set(xY.key,K.searchParams),X.set(WZ.key,{route:z,params:K.params});let _=X.get(T1.key);if(_&&_._tag==="Span")_.attribute("http.route",z.path);return J6(z.uninterruptible?z.handler:jJ(z.handler),bY(X))});if(Z.size===0)return J;for(let Q of wJ(Z))J=Q(J);return J}})});function V2(Y,Z){let $=Z.length;return Y.modify({url:Y.url.length<=$?"/":Y.url.slice($)})}var v1=j("effect/http/HttpRouter/RouterConfig",{defaultValue:()=>({})});class WZ extends S()("effect/http/HttpRouter/RouteContext"){}var RJ=L(WZ.asEffect(),(Y)=>Y.params),z2=(Y,Z)=>{let $=f(Y);return ZY((J)=>{let Q=y(J,M),X=y(J,xY),G=y(J,WZ);return U(Q.json,(K)=>$({method:Q.method,url:Q.url,headers:Q.headers,cookies:Q.cookies,pathParams:G.params,searchParams:X,body:K},Z))})},_2=(Y,Z)=>{let $=f(Y);return ZY((J)=>{let Q=y(J,M),X=y(J,xY),G=y(J,WZ);return $({method:Q.method,url:Q.url,headers:Q.headers,cookies:Q.cookies,pathParams:G.params,searchParams:X},Z)})},B2=(Y,Z)=>{let $=f(Y);return ZY((J)=>{let Q=y(J,xY),X=y(J,WZ);return $({...Q,...X.params},Z)})},O2=(Y,Z)=>{let $=f(Y);return U(RJ,(J)=>$(J,Z))},SJ=(Y)=>DZ(U(LY.asEffect(),Y)),D2=(Y,Z,$,J)=>SJ((Q)=>Q.add(Y,Z,$,J)),W2=(Y,Z)=>DZ(i(function*(){let $=FY(Y)?yield*Y:Y,J=yield*LY;if(Z?.prefix)J=J.prefixed(Z.prefix);yield*J.addAll($)})),xZ=pY(LY)(vJ),A2=(Y)=>i(function*(){let Z=yield*Z6(sY(Y,xZ));return y(Z,LY).asHttpEffect()}),LJ="~effect/http/HttpRouter/Route",j1=(Y)=>({...Y,uninterruptible:Y.uninterruptible??!1,prefix:typeof Y.prefix==="string"?b(Y.prefix):Y.prefix??H(),[LJ]:LJ}),gJ=(Y,Z,$,J)=>j1({...J,method:Y,path:Z,handler:AY($)?F($):FY($)?$:U(M.asEffect(),$),uninterruptible:J?.uninterruptible??!1}),U2=(Y)=>Y.endsWith("/")?Y.slice(0,-1):Y,T0=O(2,(Y,Z)=>{if(Z=U2(Z),Y==="*")return`${Z}/*`;else if(Y==="/")return Z;return Z+Y}),CJ=O(2,(Y,Z)=>j1({...Y,path:T0(Y.path,Z),prefix:BY(Y.prefix,{onNone:()=>Z,onSome:($)=>T0($,Z)})})),F2="~effect/http/HttpRouter/Middleware",R1=function(){if(arguments.length===0)return MJ;return MJ(arguments[0],arguments[1])},MJ=(Y,Z)=>Z?.global?DZ(i(function*(){let $=yield*LY,J=FY(Y)?yield*Y:Y;yield*$.addGlobalMiddleware(J)})):new Q6(FY(Y)?$6(L(Y,($)=>bY(new Map([[e5,$]])))):IJ(bY(new Map([[e5,Y]])))),N2=0,e5="effect/http/HttpRouter/MiddlewareFn";class Q6{[F2]={};layerFn;dependencies;constructor(Y,Z){this.layerFn=Y,this.dependencies=Z;let $=`effect/http/HttpRouter/Middleware-${++N2}`;this.layer=$6(i({self:this},function*(){let J=yield*E5(),Q=[J.mapUnsafe.get(e5)];if(this.dependencies){let X=yield*EJ,G=y(J,L0),K=yield*H1(this.dependencies,X,G);Q.push(...bJ(K))}return bY(new Map([[$,Q]]))})).pipe(rY(this.layerFn))}layer;combine(Y){return new Q6(this.layerFn,this.dependencies?sY(this.dependencies,Y.layer):Y.layer)}}var TJ=new WeakMap,bJ=(Y)=>{let Z=TJ.get(Y);if(Z)return Z;let $=HJ(),J=0;for(let[Q,X]of Y.mapUnsafe)if(Q.startsWith("effect/http/HttpRouter/Middleware-")){if($.push(X),X.length>J)J=X.length}if($.length===0)Z=[];else{let Q=new Set;for(let X=J-1;X>=0;X--)for(let G of $)if(X<G.length)Q.add(G[X]);Z=y0(Q).reverse()}return TJ.set(Y,Z),Z},L2=(Y)=>R1(t$(Y),{global:!0}),M2=R1(s$).layer,T2=(Y)=>(Z)=>rY(Z,R1()(i(function*(){let $=yield*Z6(Y);return(J)=>J6(J,$)})).layer),w2=(Y,Z)=>{let $=Z?.middleware;if(Z?.disableLogger!==!0)$=$?Y6($,N0):N0;let J=Z?.routerConfig?rY(xZ,M0(v1)(Z.routerConfig)):xZ;return i(function*(){let X=(yield*LY).asHttpEffect();return $?P1(X,$):P1(X)}).pipe(PJ,sY(Y),rY(J),Z?.disableListenLog?BZ:s5)},H2=(Y,Z)=>{let $=Z?.middleware;if(Z?.disableLogger!==!0)$=$?Y6($,N0):N0;let J=Z?.routerConfig?rY(xZ,M0(v1)(Z.routerConfig)):xZ;return KJ(sY(Y,J),{toHandler:(Q)=>F(y(Q,LY).asHttpEffect()),middleware:$,memoMap:Z?.memoMap})};export{C as us,wY as vs,fZ as ws,P0 as xs,mZ as ys,nJ as zs,lZ as As,c0 as Bs,TZ as Cs,eJ as Ds,$Y as Es,pZ as Fs,e0 as Gs,vZ as Hs,s as Is,XX as Js,BX as Ks,e7 as Ls,G1 as Ms,X8 as Ns,AY as Os,t as Ps,N3 as Qs,L3 as Rs,M3 as Ss,T3 as Ts,w3 as Us,H3 as Vs,oY as Ws,c3 as Xs,M as Ys,xY as Zs,I4 as _s,P4 as $s,j4 as at,A0 as bt,z9 as ct,t5 as dt,WZ as et,SJ as ft,gJ as gt,T0 as ht,qJ as it};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{nf as Lh}from"./chunk-n0trgp1c.js";import{of as Mt}from"./chunk-00sr2gwz.js";import"./chunk-yha554nm.js";import{wf as eh}from"./chunk-v3x5nrc4.js";import{xf as hh,zf as gt}from"./chunk-dvxk6mr6.js";import{$q as pt,Aq as bt,Jq as _t,Mq as Lt,Nq as ft,Oq as wt,Tq as jt,Uq as o,Wq as St,Yq as dt,Zq as et,br as ot,er as v,fr as r,lr as E,mr as k,or as _,rr as th,sr as Ct,tq as Y,xq as vt,zq as lt}from"./chunk-gwfx7tx7.js";import{Fr as kt,Hr as I,wr as rt}from"./chunk-1wpjmwnh.js";import"./chunk-cqtkxwd8.js";import"./chunk-ymtcm4xd.js";import{xv as h}from"./chunk-tdmn21z0.js";import"./chunk-s8mghr5a.js";import{gQ as ut}from"./chunk-4sazy0nq.js";var Ft=ut(Mt(),1);var J=ut(eh(),1);class ht{bytes;constructor(t){if(this.bytes=t,t.byteLength!==8)throw Error("Int64 buffers must be exactly 8 bytes")}static fromNumber(t){if(t>9223372036854776000||t<-9223372036854776000)throw Error(`${t} is too large (or, if negative, too small) to represent as an Int64`);let s=new Uint8Array(8);for(let a=7,y=Math.abs(Math.round(t));a>-1&&y>0;a--,y/=256)s[a]=y;if(t<0)Qt(s);return new ht(s)}valueOf(){let t=this.bytes.slice(0),s=t[0]&128;if(s)Qt(t);return parseInt(J.toHex(t),16)*(s?-1:1)}toString(){return String(this.valueOf())}}function Qt(t){for(let s=0;s<8;s++)t[s]^=255;for(let s=7;s>-1;s--)if(t[s]++,t[s]!==0)break}class Ut{toUtf8;fromUtf8;constructor(t,s){this.toUtf8=t,this.fromUtf8=s}format(t){let s=[];for(let w of Object.keys(t)){let f=this.fromUtf8(w);s.push(Uint8Array.from([f.byteLength]),f,this.formatHeaderValue(t[w]))}let a=new Uint8Array(s.reduce((w,f)=>w+f.byteLength,0)),y=0;for(let w of s)a.set(w,y),y+=w.byteLength;return a}formatHeaderValue(t){switch(t.type){case"boolean":return Uint8Array.from([t.value?0:1]);case"byte":return Uint8Array.from([2,t.value]);case"short":let s=new DataView(new ArrayBuffer(3));return s.setUint8(0,3),s.setInt16(1,t.value,!1),new Uint8Array(s.buffer);case"integer":let a=new DataView(new ArrayBuffer(5));return a.setUint8(0,4),a.setInt32(1,t.value,!1),new Uint8Array(a.buffer);case"long":let y=new Uint8Array(9);return y[0]=5,y.set(t.value.bytes,1),y;case"binary":let w=new DataView(new ArrayBuffer(3+t.value.byteLength));w.setUint8(0,6),w.setUint16(1,t.value.byteLength,!1);let f=new Uint8Array(w.buffer);return f.set(t.value,3),f;case"string":let S=this.fromUtf8(t.value),g=new DataView(new ArrayBuffer(3+S.byteLength));g.setUint8(0,7),g.setUint16(1,S.byteLength,!1);let c=new Uint8Array(g.buffer);return c.set(S,3),c;case"timestamp":let T=new Uint8Array(9);return T[0]=8,T.set(ht.fromNumber(t.value.valueOf()).bytes,1),T;case"uuid":if(!Gh.test(t.value))throw Error(`Invalid UUID received: ${t.value}`);let N=new Uint8Array(17);return N[0]=9,N.set(J.fromHex(t.value.replace(/\-/g,"")),1),N}}parse(t){let s={},a=0;while(a<t.byteLength){let y=t.getUint8(a++),w=this.toUtf8(new Uint8Array(t.buffer,t.byteOffset+a,y));switch(a+=y,t.getUint8(a++)){case 0:s[w]={type:Zt,value:!0};break;case 1:s[w]={type:Zt,value:!1};break;case 2:s[w]={type:gh,value:t.getInt8(a++)};break;case 3:s[w]={type:Ah,value:t.getInt16(a,!1)},a+=2;break;case 4:s[w]={type:mh,value:t.getInt32(a,!1)},a+=4;break;case 5:s[w]={type:Uh,value:new ht(new Uint8Array(t.buffer,t.byteOffset+a,8))},a+=8;break;case 6:let f=t.getUint16(a,!1);a+=2,s[w]={type:zh,value:new Uint8Array(t.buffer,t.byteOffset+a,f)},a+=f;break;case 7:let S=t.getUint16(a,!1);a+=2,s[w]={type:Nh,value:this.toUtf8(new Uint8Array(t.buffer,t.byteOffset+a,S))},a+=S;break;case 8:s[w]={type:Th,value:new Date(new ht(new Uint8Array(t.buffer,t.byteOffset+a,8)).valueOf())},a+=8;break;case 9:let g=new Uint8Array(t.buffer,t.byteOffset+a,16);a+=16,s[w]={type:$h,value:`${J.toHex(g.subarray(0,4))}-${J.toHex(g.subarray(4,6))}-${J.toHex(g.subarray(6,8))}-${J.toHex(g.subarray(8,10))}-${J.toHex(g.subarray(10))}`};break;default:throw Error("Unrecognized header type tag")}}return s}}var xt;(function(t){t[t.boolTrue=0]="boolTrue",t[t.boolFalse=1]="boolFalse",t[t.byte=2]="byte",t[t.short=3]="short",t[t.integer=4]="integer",t[t.long=5]="long",t[t.byteArray=6]="byteArray",t[t.string=7]="string",t[t.timestamp=8]="timestamp",t[t.uuid=9]="uuid"})(xt||(xt={}));var Zt="boolean",gh="byte",Ah="short",mh="integer",Uh="long",zh="binary",Nh="string",Th="timestamp",$h="uuid",Gh=/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/;var Dt=ut(Mt(),1),Vt=4,l=Vt*2,p=4,Xh=l+p*2;function qt({byteLength:t,byteOffset:s,buffer:a}){if(t<Xh)throw Error("Provided message too short to accommodate event stream message overhead");let y=new DataView(a,s,t),w=y.getUint32(0,!1);if(t!==w)throw Error("Reported message length does not match received message length");let f=y.getUint32(Vt,!1),S=y.getUint32(l,!1),g=y.getUint32(t-p,!1),c=new Dt.Crc32().update(new Uint8Array(a,s,l));if(S!==c.digest())throw Error(`The prelude checksum specified in the message (${S}) does not match the calculated CRC32 checksum (${c.digest()})`);if(c.update(new Uint8Array(a,s+l,t-(l+p))),g!==c.digest())throw Error(`The message checksum (${c.digest()}) did not match the expected value of ${g}`);return{headers:new DataView(a,s+l+p,f),body:new Uint8Array(a,s+l+p+f,w-f-(l+p+p))}}class zt{headerMarshaller;messageBuffer;isEndOfStream;constructor(t,s){this.headerMarshaller=new Ut(t,s),this.messageBuffer=[],this.isEndOfStream=!1}feed(t){this.messageBuffer.push(this.decode(t))}endOfStream(){this.isEndOfStream=!0}getMessage(){let t=this.messageBuffer.pop(),s=this.isEndOfStream;return{getMessage(){return t},isEndOfStream(){return s}}}getAvailableMessages(){let t=this.messageBuffer;this.messageBuffer=[];let s=this.isEndOfStream;return{getMessages(){return t},isEndOfStream(){return s}}}encode({headers:t,body:s}){let a=this.headerMarshaller.format(t),y=a.byteLength+s.byteLength+16,w=new Uint8Array(y),f=new DataView(w.buffer,w.byteOffset,w.byteLength),S=new Ft.Crc32;return f.setUint32(0,y,!1),f.setUint32(4,a.byteLength,!1),f.setUint32(8,S.update(w.subarray(0,8)).digest(),!1),w.set(a,12),w.set(s,a.byteLength+12),f.setUint32(y-4,S.update(w.subarray(8,y-4)).digest(),!1),w}decode(t){let{headers:s,body:a}=qt(t);return{headers:this.headerMarshaller.parse(s),body:a}}formatHeaders(t){return this.headerMarshaller.format(t)}}var At=ut(Lh(),1);var Tt=new TextEncoder,bh={appstream2:"appstream",cloudhsmv2:"cloudhsm",email:"ses",marketplace:"aws-marketplace",mobile:"AWSMobileHubService",pinpoint:"mobiletargeting",queue:"sqs","git-codecommit":"codecommit","mturk-requester-sandbox":"mturk-requester","personalize-runtime":"personalize"},jh=new Set(["authorization","content-type","content-length","user-agent","presigned-expires","expect","x-amzn-trace-id","range","connection"]);class $t{constructor({method:t,url:s,headers:a,body:y,accessKeyId:w,secretAccessKey:f,sessionToken:S,service:g,region:c,cache:T,datetime:N,signQuery:j,appendSessionToken:e,allHeaders:A,singleEncode:m}){if(s==null)throw TypeError("url is a required option");if(w==null)throw TypeError("accessKeyId is a required option");if(f==null)throw TypeError("secretAccessKey is a required option");this.method=t||(y?"POST":"GET"),this.url=new URL(s),this.headers=new Headers(a||{}),this.body=y,this.accessKeyId=w,this.secretAccessKey=f,this.sessionToken=S;let $,i;if(!g||!c)[$,i]=Ch(this.url,this.headers);if(this.service=g||$||"",this.region=c||i||"us-east-1",this.cache=T||new Map,this.datetime=N||new Date().toISOString().replace(/[:-]|\.\d{3}/g,""),this.signQuery=j,this.appendSessionToken=e||this.service==="iotdevicegateway",this.headers.delete("Host"),this.service==="s3"&&!this.signQuery&&!this.headers.has("X-Amz-Content-Sha256"))this.headers.set("X-Amz-Content-Sha256","UNSIGNED-PAYLOAD");let H=this.signQuery?this.url.searchParams:this.headers;if(H.set("X-Amz-Date",this.datetime),this.sessionToken&&!this.appendSessionToken)H.set("X-Amz-Security-Token",this.sessionToken);if(this.signableHeaders=["host",...this.headers.keys()].filter((u)=>A||!jh.has(u)).sort(),this.signedHeaders=this.signableHeaders.join(";"),this.canonicalHeaders=this.signableHeaders.map((u)=>u+":"+(u==="host"?this.url.host:(this.headers.get(u)||"").replace(/\s+/g," "))).join(`
|
|
3
3
|
`),this.credentialString=[this.datetime.slice(0,8),this.region,this.service,"aws4_request"].join("/"),this.signQuery){if(this.service==="s3"&&!H.has("X-Amz-Expires"))H.set("X-Amz-Expires","86400");H.set("X-Amz-Algorithm","AWS4-HMAC-SHA256"),H.set("X-Amz-Credential",this.accessKeyId+"/"+this.credentialString),H.set("X-Amz-SignedHeaders",this.signedHeaders)}if(this.service==="s3")try{this.encodedPath=decodeURIComponent(this.url.pathname.replace(/\+/g," "))}catch(u){this.encodedPath=this.url.pathname}else this.encodedPath=this.url.pathname.replace(/\/+/g,"/");if(!m)this.encodedPath=encodeURIComponent(this.encodedPath).replace(/%2F/g,"/");this.encodedPath=Yt(this.encodedPath);let C=new Set;this.encodedSearch=[...this.url.searchParams].filter(([u])=>{if(!u)return!1;if(this.service==="s3"){if(C.has(u))return!1;C.add(u)}return!0}).map((u)=>u.map((X)=>Yt(encodeURIComponent(X)))).sort(([u,X],[L,W])=>u<L?-1:u>L?1:X<W?-1:X>W?1:0).map((u)=>u.join("=")).join("&")}async sign(){if(this.signQuery){if(this.url.searchParams.set("X-Amz-Signature",await this.signature()),this.sessionToken&&this.appendSessionToken)this.url.searchParams.set("X-Amz-Security-Token",this.sessionToken)}else this.headers.set("Authorization",await this.authHeader());return{method:this.method,url:this.url,headers:this.headers,body:this.body}}async authHeader(){return["AWS4-HMAC-SHA256 Credential="+this.accessKeyId+"/"+this.credentialString,"SignedHeaders="+this.signedHeaders,"Signature="+await this.signature()].join(", ")}async signature(){let t=this.datetime.slice(0,8),s=[this.secretAccessKey,t,this.region,this.service].join(),a=this.cache.get(s);if(!a){let y=await at("AWS4"+this.secretAccessKey,t),w=await at(y,this.region),f=await at(w,this.service);a=await at(f,"aws4_request"),this.cache.set(s,a)}return Nt(await at(a,await this.stringToSign()))}async stringToSign(){return["AWS4-HMAC-SHA256",this.datetime,this.credentialString,Nt(await Pt(await this.canonicalString()))].join(`
|
|
4
4
|
`)}async canonicalString(){return[this.method.toUpperCase(),this.encodedPath,this.encodedSearch,this.canonicalHeaders+`
|
|
5
5
|
`,this.signedHeaders,await this.hexBodyHash()].join(`
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{ju as D}from"./chunk-qp9y0g73.js";import{Au as y,vu as h,wu as w,xu as M,yu as O,zu as b}from"./chunk-j21dnncc.js";import{iQ as N}from"./chunk-4sazy0nq.js";var H={free:{providerID:"qlex",modelID:"free"},default:{providerID:"qlex",modelID:"default"},fast:{providerID:"qlex",modelID:"fast"},economical:{providerID:"qlex",modelID:"economical"},power:{providerID:"qlex",modelID:"power"},orchestrated:{providerID:"qlex",modelID:"orchestrated"}},V={free:"Free (no cost)",default:"Default",fast:"Fast",economical:"Economy",power:"Power",orchestrated:"Orchestrated"},Z={},c="pending",Q=new Set;function F(){return c}function Y(){c="pending",X()}function f(x){return Q.add(x),()=>Q.delete(x)}function X(){for(let x of[...Q])try{x()}catch{}}function q(){for(let x of Object.keys(Z))delete Z[x];c="unavailable",X()}function P(x){return typeof x==="number"&&Number.isFinite(x)&&x>=0&&x<=10}function C(x){if(x===void 0){q();return}let K=x!==null&&typeof x==="object"&&!Array.isArray(x)?x:void 0;if(K?.success===!1){q();return}let J=K?.success===!0&&Object.prototype.hasOwnProperty.call(K,"data")?K.data:x,j={};if(J===null||typeof J!=="object"||Array.isArray(J)){q();return}for(let[W,$]of Object.entries(J)){if(!$||typeof $!=="object"||Array.isArray($)){q();return}let z=$;if(!P(z.intelligence)||!P(z.speed)||!P(z.cost)){q();return}j[W]={intelligence:z.intelligence,speed:z.speed,cost:z.cost}}for(let W of Object.keys(Z))delete Z[W];Object.assign(Z,j),c="live",X()}function B(x){if(!Array.isArray(x)||x.length===0)return;let K={},J={};for(let j of x){let W=H[j.id];K[j.id]={providerID:j.providerID??W?.providerID??"qlex",modelID:j.modelID??W?.modelID??j.id},J[j.id]=j.label??V[j.id]??j.id}for(let j of Object.keys(H))delete H[j];Object.assign(H,K);for(let j of Object.keys(V))delete V[j];Object.assign(V,J)}var G={};N(G,{tiers:()=>A,tierRatingsState:()=>F,tierRatings:()=>L,streamUrl:()=>_,streamBaseUrl:()=>I,sanitizeUpstreamError:()=>g,qlexProviderMeta:()=>E,onTierRatingsChange:()=>f,omniqueryBaseUrl:()=>o,mergeLiveTiers:()=>k,mergeLiveTierRatings:()=>u,markTierRatingsUnavailable:()=>q,loadLiveRatings:()=>m,evaluatePermission:()=>S,copy:()=>v,beginTierRatingsLoad:()=>Y,bashPrefixWith:()=>d,TIER_RATINGS:()=>Z,AGENT_PROMPT_NAMES:()=>T});var p=3,U=[250,750];async function m(x){for(let K=0;K<p;K++){let J=await x();if(J!==void 0)return J;let j=U[K];if(j!==void 0)await new Promise((W)=>setTimeout(W,j))}return}function k(x){B(x)}function u(x){C(x)}function A(){return Object.entries(H).map(([x,K])=>({id:x,label:V[x]??x,providerID:K.providerID,modelID:K.modelID}))}function L(){return Z}function S(x,K,...J){return J.flat().findLast(($)=>D(x,$.permission)&&D(K,$.pattern))??{action:"ask",permission:x,pattern:"*"}}function d(x,K){for(let J=K.length;J>0;J--){let j=K.slice(0,J).join(" "),W=x[j];if(W!==void 0)return K.slice(0,W)}if(K.length===0)return[];return K.slice(0,1)}function _(){return h}function I(){return w}function o(){return M}function E(){return O}function g(x){return b(x)}function v(){return y}var T=["generate","explore","dream","distill","summary","compaction","title"];export{H as Pt,G as Qt};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Fu as E}from"./chunk-j21dnncc.js";function q(w){return!!w&&typeof w==="object"&&!Array.isArray(w)}function C(w){if(!q(w))return;let A=w.diagnostic,j=q(w.data)?w.data.diagnostic:void 0,p=q(A)?A:q(j)?j:void 0;if(!p){let h=w.cause;return h!==w?C(h):void 0}if(typeof p.errorID!=="string"||typeof p.errorName!=="string"||typeof p.logFile!=="string")return;return{errorID:p.errorID,errorName:p.errorName,logFile:p.logFile}}function J(w){return C(w)}function K(w,A){let j=C(w);if(j)return j;let p=A??(q(w)&&typeof w.name==="string"?w.name:w instanceof Error?w.name:"UnknownError"),h={errorID:crypto.randomUUID(),errorName:p,logFile:E()};if(q(w))try{Object.defineProperty(w,"diagnostic",{value:h,enumerable:!0,configurable:!0})}catch{}return h}function D(w){if(w instanceof Error)return w.stack??`${w.name}: ${w.message}`;if(typeof w==="object"&&w!==null){let A=z(w);if(A!=="unknown error")return A;try{return JSON.stringify(w,null,2)}catch{return"Unexpected error (unserializable)"}}return String(w)}function z(w){if(w instanceof Error){if(w.message)return w.message;if(w.name)return w.name}if(q(w)&&typeof w.message==="string"&&w.message)return w.message;if(q(w)&&q(w.data)&&typeof w.data.message==="string"&&w.data.message)return w.data.message;let A=String(w);if(A&&A!=="[object Object]")return A;let j=D(w);if(j&&j!=="{}")return j;return"unknown error"}function L(w){if(w instanceof Error)return{type:w.name,message:z(w),stack:w.stack,cause:w.cause===void 0?void 0:D(w.cause),formatted:B(w)};if(!q(w))return{type:typeof w,message:z(w),formatted:B(w)};let A=Object.getOwnPropertyNames(w).reduce((j,p)=>{let h=w[p];if(h===void 0)return j;if(typeof h==="string"||typeof h==="number"||typeof h==="boolean")return j[p]=h,j;return j[p]=h instanceof Error?h.message:String(h),j},{});if(typeof A.message!=="string")A.message=z(w);if(typeof A.type!=="string")A.type=w.constructor?.name;return A.formatted=B(w),A}function B(w){let A=D(w);if(A!=="{}")return A;return String(w)}
|
|
3
|
+
export{q as qu,J as ru,K as su,z as tu,L as uu};
|