claude-code-best 1.4.3 → 1.5.0
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/README.md +1 -0
- package/dist/{chunk-wpcgztry.js → chunk-07hgsrrj.js} +61 -65
- package/dist/{chunk-yamdfram.js → chunk-08s2vf8j.js} +51 -52
- package/dist/{chunk-rde4wtp8.js → chunk-099vkedx.js} +2 -2
- package/dist/{chunk-pj0866mn.js → chunk-0bbrkswa.js} +1 -1
- package/dist/{chunk-0dwxmzv5.js → chunk-0bqtrr6h.js} +55 -56
- package/dist/{chunk-kbzh54rh.js → chunk-0g5qnby7.js} +6 -6
- package/dist/{chunk-bec4mkst.js → chunk-0h1mmmrb.js} +15 -15
- package/dist/{chunk-5dhrvrtg.js → chunk-0j7426hg.js} +2 -2
- package/dist/{chunk-0z0m6mm5.js → chunk-0k1jmtw9.js} +2 -2
- package/dist/{chunk-z3hw83qk.js → chunk-0k5v3m41.js} +49 -50
- package/dist/chunk-0kd8mq8j.js +36 -0
- package/dist/{chunk-3fp4s54c.js → chunk-0n0ca69d.js} +8 -8
- package/dist/{chunk-pp147tk2.js → chunk-0qakcnby.js} +47 -48
- package/dist/chunk-0s7za42b.js +14 -0
- package/dist/{chunk-fb2ta2tx.js → chunk-0tmg91b1.js} +47 -48
- package/dist/{chunk-mcyyqkv6.js → chunk-0v20v2af.js} +3 -3
- package/dist/{chunk-dmj8nwb4.js → chunk-0v2awzd5.js} +1 -1
- package/dist/{chunk-5fnc2arn.js → chunk-0v590295.js} +148 -148
- package/dist/{chunk-rwz2d4a6.js → chunk-0va3y97h.js} +50 -51
- package/dist/{chunk-r26enj81.js → chunk-0vcpjqz5.js} +18 -18
- package/dist/{chunk-nnjw47pz.js → chunk-0vvk6tv4.js} +15 -15
- package/dist/{chunk-k4zz5qt6.js → chunk-0w957a33.js} +50 -51
- package/dist/{chunk-vnkmsvcm.js → chunk-0wtwnyvg.js} +1 -1
- package/dist/chunk-0xereag4.js +173 -0
- package/dist/{chunk-34ct1dk0.js → chunk-0z5j99bj.js} +16 -16
- package/dist/{chunk-6bd8brc4.js → chunk-0zkw14gq.js} +3 -3
- package/dist/{chunk-jfhmk1c6.js → chunk-13zdd5e6.js} +38 -32
- package/dist/{chunk-3me3nd70.js → chunk-16gq8x0y.js} +49 -50
- package/dist/{chunk-apyd6jg3.js → chunk-19gdjrk6.js} +3 -3
- package/dist/{chunk-strvbymz.js → chunk-1dym9vfh.js} +37 -31
- package/dist/chunk-1g68v32a.js +17 -0
- package/dist/{chunk-ztb7kzx4.js → chunk-1k83dgjb.js} +49 -50
- package/dist/{chunk-sfqs55dz.js → chunk-1kr4x0ec.js} +16 -16
- package/dist/chunk-1v0q0tce.js +104 -0
- package/dist/{chunk-m41d561t.js → chunk-1y0w6mjw.js} +48 -49
- package/dist/{chunk-gjfa8v40.js → chunk-1ymrygy1.js} +3 -3
- package/dist/{chunk-cd48n5z6.js → chunk-1zzfvmmk.js} +47 -48
- package/dist/{chunk-qyeh87q9.js → chunk-23j983cf.js} +48 -49
- package/dist/{chunk-t0644p95.js → chunk-25xrykpm.js} +47 -48
- package/dist/{chunk-1c9eqthz.js → chunk-26yzm962.js} +47 -48
- package/dist/{chunk-11rpa5zm.js → chunk-279m39zm.js} +2 -2
- package/dist/chunk-27an25fd.js +118 -0
- package/dist/{chunk-c9js3490.js → chunk-2br81xts.js} +13 -13
- package/dist/chunk-2eftymgs.js +70 -0
- package/dist/{chunk-dmk1xmtv.js → chunk-2n53zm0g.js} +1 -1
- package/dist/{chunk-0tqqepp7.js → chunk-2ppy5p0x.js} +1 -1
- package/dist/chunk-2rhny2td.js +542 -0
- package/dist/{chunk-691kttad.js → chunk-2s2z24wm.js} +47 -48
- package/dist/{chunk-0bthwtc4.js → chunk-2tt7xc2t.js} +2 -2
- package/dist/{chunk-813bqtt4.js → chunk-2wy13rhe.js} +14 -14
- package/dist/{chunk-1y0e25vy.js → chunk-2xx8f4qv.js} +4 -4
- package/dist/{chunk-6v12h56j.js → chunk-32mtrtm4.js} +48 -49
- package/dist/{chunk-wjhhetv4.js → chunk-32vdb088.js} +208 -202
- package/dist/{chunk-03qpgz7e.js → chunk-36yypykx.js} +2151 -2124
- package/dist/{chunk-01pfrqr8.js → chunk-381w6mma.js} +1 -1
- package/dist/{chunk-c5mxmjvf.js → chunk-3cghr0yw.js} +47 -48
- package/dist/chunk-3dpdscmt.js +5332 -0
- package/dist/{chunk-c4r8jfrs.js → chunk-3dv5ctj4.js} +48 -49
- package/dist/{chunk-wkxg48gk.js → chunk-3es5r0dx.js} +48 -49
- package/dist/chunk-3fapt8z5.js +3686 -0
- package/dist/{chunk-xxdk3d0d.js → chunk-3gpxmzz8.js} +3 -3
- package/dist/{chunk-t6w2xwm7.js → chunk-3xh6v618.js} +47 -48
- package/dist/{chunk-nh76pgrt.js → chunk-3xw21x85.js} +2 -2
- package/dist/{chunk-cbssxph9.js → chunk-3zyt28ea.js} +14 -14
- package/dist/{chunk-gwkgfkj5.js → chunk-40d286da.js} +5 -5
- package/dist/{chunk-ew5daj4s.js → chunk-42k22r18.js} +1 -1
- package/dist/{chunk-ygc38zsc.js → chunk-456m81he.js} +47 -48
- package/dist/{chunk-309spvbz.js → chunk-46bqcdpf.js} +5 -5
- package/dist/{chunk-w61znt0r.js → chunk-4b5peb6p.js} +7 -7
- package/dist/chunk-4cfcpzb1.js +25 -0
- package/dist/chunk-4ch5vxv6.js +55 -0
- package/dist/chunk-4drj3c7m.js +9 -0
- package/dist/{chunk-s0f9h1ke.js → chunk-4h5zefyh.js} +48 -49
- package/dist/{chunk-q33kdbcv.js → chunk-4n6tnssg.js} +75 -50
- package/dist/{chunk-w0hw971e.js → chunk-4pr3ph3g.js} +14 -14
- package/dist/{chunk-jff3fbst.js → chunk-4sahp0qz.js} +93 -101
- package/dist/{chunk-sxceea76.js → chunk-4ymyjjq9.js} +6 -6
- package/dist/{chunk-05tebmww.js → chunk-50ykc5qt.js} +2 -2
- package/dist/{chunk-qq72x3fs.js → chunk-53dr4k73.js} +3 -3
- package/dist/chunk-58fwsj1y.js +718 -0
- package/dist/chunk-59dp4z1p.js +157 -0
- package/dist/chunk-5b4v2zkf.js +1095 -0
- package/dist/{chunk-6h9gxb9m.js → chunk-5c62s229.js} +14 -14
- package/dist/{chunk-kgj9893t.js → chunk-5f4n0ywb.js} +48 -49
- package/dist/{chunk-zypp6syd.js → chunk-5gv4sshz.js} +47 -48
- package/dist/{chunk-tj45shek.js → chunk-5m6942nd.js} +5 -5
- package/dist/{chunk-ykr5qx9v.js → chunk-5nccnh01.js} +123 -103
- package/dist/{chunk-1gj0pnga.js → chunk-5q5xcm1a.js} +47 -48
- package/dist/{chunk-x6v6emh0.js → chunk-5wq9nsdc.js} +3 -3
- package/dist/{chunk-n0y737n2.js → chunk-5x2nq6b9.js} +55 -58
- package/dist/{chunk-d6qweage.js → chunk-5y6k4xrs.js} +2 -2
- package/dist/{chunk-qbaszyg6.js → chunk-63q03fkn.js} +47 -48
- package/dist/{chunk-wsx9nt4e.js → chunk-65w3ek1a.js} +17 -17
- package/dist/{chunk-q80ddpch.js → chunk-67w1zken.js} +16 -16
- package/dist/{chunk-5q0pv8vm.js → chunk-6ccsyy1d.js} +1 -1
- package/dist/{chunk-fhfp2q8c.js → chunk-6ct7fh1v.js} +3 -3
- package/dist/{chunk-yefearm8.js → chunk-6d1y8a8t.js} +2 -2
- package/dist/{chunk-ndbcx9we.js → chunk-6dcmw81a.js} +22 -22
- package/dist/{chunk-bg0k9ktd.js → chunk-6eb1nz6v.js} +3 -3
- package/dist/{chunk-zm12zvc2.js → chunk-6frqd366.js} +50 -51
- package/dist/chunk-6m81e182.js +81 -0
- package/dist/{chunk-j6k3zjb5.js → chunk-6ns89pft.js} +25 -17
- package/dist/chunk-6vqkv5g7.js +256 -0
- package/dist/{chunk-k7qcpvdq.js → chunk-6weddn5h.js} +49 -50
- package/dist/{chunk-5tscygm0.js → chunk-7a6r0k3m.js} +47 -48
- package/dist/{chunk-r7n5brf9.js → chunk-7b2e9e81.js} +15 -17
- package/dist/{chunk-d5qv71vm.js → chunk-7bc12031.js} +14 -12
- package/dist/{chunk-49hrrcw1.js → chunk-7brvkna2.js} +53 -54
- package/dist/{chunk-gptd9heq.js → chunk-7bs8swa2.js} +7 -7
- package/dist/{chunk-0925w20x.js → chunk-7dgqzj7h.js} +50 -51
- package/dist/{chunk-e6yh7vb2.js → chunk-7dk4m49a.js} +48 -49
- package/dist/{chunk-8y6xx3na.js → chunk-7e9hc8ce.js} +52 -53
- package/dist/{chunk-90wp6wez.js → chunk-7ebcff63.js} +2 -2
- package/dist/{chunk-pjmqey38.js → chunk-7ecg65mr.js} +1 -1
- package/dist/{chunk-zttmdag3.js → chunk-7fht54sw.js} +1 -1
- package/dist/{chunk-djhtjksq.js → chunk-7j845cqe.js} +47 -48
- package/dist/chunk-7jk88vww.js +782 -0
- package/dist/{chunk-ecj9mwz9.js → chunk-7kfb7tqj.js} +2 -2
- package/dist/{chunk-rbkhemh9.js → chunk-7p437ydk.js} +37 -31
- package/dist/{chunk-a9zh40sj.js → chunk-7q7h7msb.js} +3 -3
- package/dist/{chunk-aex4kmfm.js → chunk-7ye0arvq.js} +1 -1
- package/dist/{chunk-s8atpq1r.js → chunk-7z17cw4h.js} +47 -48
- package/dist/{chunk-hxc8e6wd.js → chunk-7zrkp054.js} +2 -2
- package/dist/chunk-82jkr65n.js +16 -0
- package/dist/{chunk-avbb5066.js → chunk-838naekw.js} +2 -2
- package/dist/{chunk-32p0jkaj.js → chunk-879maaae.js} +47 -48
- package/dist/chunk-87zgmycv.js +65 -0
- package/dist/{chunk-fb7hgch7.js → chunk-8shx4hgv.js} +48 -49
- package/dist/{chunk-czk5s0d6.js → chunk-8vt2rmzz.js} +52 -53
- package/dist/{chunk-grvhbg1q.js → chunk-8wmyjwn2.js} +2 -2
- package/dist/{chunk-27ezf4tc.js → chunk-8wq0z465.js} +1 -1
- package/dist/{chunk-1feqvkrs.js → chunk-8ym1t31g.js} +53 -54
- package/dist/{chunk-1jp931g0.js → chunk-8z33fy5n.js} +49 -50
- package/dist/chunk-91abjr1g.js +29 -0
- package/dist/{chunk-g649rtg8.js → chunk-9230kmx2.js} +7 -6
- package/dist/{chunk-s39ksgef.js → chunk-93qhgq6p.js} +1 -1
- package/dist/{chunk-qx67chz8.js → chunk-9629mtdz.js} +1 -1
- package/dist/{chunk-g4wnmj57.js → chunk-9b04n6d1.js} +1 -1
- package/dist/{chunk-fengsq7f.js → chunk-9fpha2xv.js} +6 -6
- package/dist/{chunk-469hyn07.js → chunk-9stsxjba.js} +4 -4
- package/dist/{chunk-e1f6mcs9.js → chunk-9t7nxd80.js} +1 -1
- package/dist/{chunk-wx1f33e7.js → chunk-9vebtp7v.js} +52 -53
- package/dist/{chunk-bgbp3zkb.js → chunk-a7kdj8mj.js} +54 -55
- package/dist/{chunk-7rncd7c0.js → chunk-acts7vdr.js} +10 -10
- package/dist/{chunk-xthpe23e.js → chunk-adgamch7.js} +57 -60
- package/dist/{chunk-g588xxp7.js → chunk-ahebrd5y.js} +5 -5
- package/dist/{chunk-8b70kazk.js → chunk-am5cn48y.js} +4 -4
- package/dist/{chunk-541f5hfx.js → chunk-apwjfffr.js} +1 -1
- package/dist/{chunk-rbfe062s.js → chunk-ayn250r2.js} +16 -16
- package/dist/chunk-b0bk6bxs.js +742 -0
- package/dist/{chunk-c358prbg.js → chunk-b0yyp8et.js} +4210 -253
- package/dist/{chunk-d9fng1q2.js → chunk-bg3zs6s3.js} +1 -1
- package/dist/chunk-btnvjcc5.js +15 -0
- package/dist/{chunk-z7dv1v7n.js → chunk-by7nh2js.js} +18 -18
- package/dist/{chunk-3g4s34f4.js → chunk-c0yhh86m.js} +3 -3
- package/dist/{chunk-6dfy9qjt.js → chunk-c68754tz.js} +5 -5
- package/dist/chunk-cga5sq7g.js +41 -0
- package/dist/{chunk-v30g8yjp.js → chunk-cjzk6t5c.js} +1 -1
- package/dist/chunk-ck06sqpy.js +220 -0
- package/dist/{chunk-bh9dh708.js → chunk-ck3q71vq.js} +2 -2
- package/dist/{chunk-gtzjdd18.js → chunk-cqbkd5ec.js} +3 -3
- package/dist/{chunk-c0mdv9w6.js → chunk-cqym51bf.js} +6 -6
- package/dist/{chunk-3ybsbz1m.js → chunk-cvqjhmqj.js} +56 -57
- package/dist/{chunk-fejedxv7.js → chunk-cxy1ed0h.js} +3 -3
- package/dist/{chunk-a4c4m0nx.js → chunk-czjvd1xh.js} +91 -1806
- package/dist/{chunk-9f1w8esq.js → chunk-d0hj14fq.js} +65 -66
- package/dist/{chunk-d015m8yn.js → chunk-d2kj6nek.js} +2 -2
- package/dist/{chunk-9s5zmrvx.js → chunk-d37y1qja.js} +53 -54
- package/dist/{chunk-819mbp4a.js → chunk-d4x13kaa.js} +53 -54
- package/dist/{chunk-ch7hgejq.js → chunk-d6kw0esk.js} +1200 -161
- package/dist/{chunk-9aak4pwq.js → chunk-d7jqw171.js} +47 -48
- package/dist/{chunk-nt3r80s6.js → chunk-d7xarb4w.js} +50 -51
- package/dist/{chunk-k3p4x944.js → chunk-db3pr49y.js} +1 -1
- package/dist/{chunk-8yqnkf9n.js → chunk-dbfg6qhf.js} +2 -2
- package/dist/{chunk-brg57n5r.js → chunk-dcs7myc3.js} +7 -7
- package/dist/{chunk-8rmntsad.js → chunk-ddyjgjpq.js} +47 -48
- package/dist/chunk-dgv19cce.js +183 -0
- package/dist/{chunk-k3eb60ct.js → chunk-djrgjmyj.js} +1 -1
- package/dist/{chunk-g9tce9xp.js → chunk-djye5k50.js} +56 -59
- package/dist/{chunk-35c6r949.js → chunk-dknvhgkn.js} +3 -3
- package/dist/{chunk-s2t3qrte.js → chunk-drth8ce0.js} +1 -1
- package/dist/{chunk-dpzvkxtn.js → chunk-dt26hy6y.js} +1 -1
- package/dist/{chunk-cp21k6j3.js → chunk-dw5n6pr6.js} +47 -48
- package/dist/{chunk-ze6zvkg6.js → chunk-dxcr07z5.js} +4 -4
- package/dist/{chunk-bx42jx3q.js → chunk-dz32qcdd.js} +1 -1
- package/dist/chunk-e2cwk4hm.js +1185 -0
- package/dist/{chunk-964fpq2b.js → chunk-e50jgy7e.js} +14 -14
- package/dist/{chunk-dq4mt605.js → chunk-e6trsfsm.js} +47 -48
- package/dist/{chunk-7cn3st3a.js → chunk-e6x5rpgx.js} +2 -2
- package/dist/{chunk-krcxgtkq.js → chunk-e84ydbsq.js} +49 -50
- package/dist/{chunk-e1z0nyq5.js → chunk-e96pr3z1.js} +48 -49
- package/dist/{chunk-6kr82nrb.js → chunk-eaawf61a.js} +47 -48
- package/dist/{chunk-6fbnt5h9.js → chunk-eck5mjcw.js} +47 -48
- package/dist/{chunk-jf3995b3.js → chunk-egtb28zm.js} +233 -256
- package/dist/chunk-enhtm7h3.js +1731 -0
- package/dist/{chunk-n1hc1e25.js → chunk-ep3h3f40.js} +47 -48
- package/dist/{chunk-5b3k6tpd.js → chunk-eqrxxgwx.js} +47 -48
- package/dist/chunk-es6y15pn.js +42 -0
- package/dist/{chunk-8czrx8ht.js → chunk-etjwrq2s.js} +27 -27
- package/dist/{chunk-6bsm0zew.js → chunk-ezbeckn3.js} +74 -51
- package/dist/{chunk-3fqxcp51.js → chunk-f109n77b.js} +14 -12
- package/dist/{chunk-kw1hpgh9.js → chunk-f29erv6g.js} +1 -1
- package/dist/{chunk-1vddy71a.js → chunk-f3hyhcgd.js} +48 -49
- package/dist/{chunk-y49d81am.js → chunk-fc9we717.js} +57 -60
- package/dist/{chunk-djydtvkr.js → chunk-fekynwj1.js} +505 -211
- package/dist/{chunk-572eqfcb.js → chunk-fks8ej56.js} +49 -50
- package/dist/{chunk-8zfdkr9j.js → chunk-frwxzq55.js} +47 -48
- package/dist/{chunk-6rcfewfp.js → chunk-ftdfvq1w.js} +4 -4
- package/dist/{chunk-w4pyvjtz.js → chunk-fx0xd0ex.js} +4 -4
- package/dist/{chunk-xpsb3jm8.js → chunk-fx52a9s2.js} +1 -1
- package/dist/{chunk-3nxv7rc1.js → chunk-fxgt3m0a.js} +47 -48
- package/dist/{chunk-wvac5hhg.js → chunk-fxm5s7sf.js} +15 -15
- package/dist/{chunk-bkafccpc.js → chunk-fy2qr4hw.js} +48 -49
- package/dist/{chunk-5aw4k8fc.js → chunk-fz395yre.js} +1 -1
- package/dist/{chunk-tsd9qae1.js → chunk-g0pmcggh.js} +2 -2
- package/dist/{chunk-1nkqjw8f.js → chunk-g45rr3sj.js} +1 -1
- package/dist/{chunk-q27bsq0y.js → chunk-g5kf8gsq.js} +4 -4
- package/dist/{chunk-5vkft7fk.js → chunk-g9p7fypd.js} +47 -48
- package/dist/{chunk-ep17krqe.js → chunk-gbjhmjds.js} +9 -35
- package/dist/chunk-gd1ye7ef.js +168 -0
- package/dist/{chunk-spbanbyj.js → chunk-gfmss0fm.js} +15 -15
- package/dist/{chunk-xnakns4w.js → chunk-gg7ay6js.js} +47 -48
- package/dist/{chunk-777vk9pb.js → chunk-gk6v4y3r.js} +36 -32
- package/dist/{chunk-zftb15xp.js → chunk-gpgcar7e.js} +49 -50
- package/dist/{chunk-k384qakk.js → chunk-gps4nmr6.js} +47 -48
- package/dist/{chunk-tp7b8ek9.js → chunk-gsa7bq8w.js} +6 -8
- package/dist/{chunk-m7m8tbj3.js → chunk-gsh55gb1.js} +2 -2
- package/dist/{chunk-mmn3cbyd.js → chunk-gv7bchnx.js} +47 -48
- package/dist/{chunk-enkmd54m.js → chunk-gvg7arvr.js} +47 -48
- package/dist/chunk-gxnyeps9.js +3 -3
- package/dist/{chunk-3c1emyyp.js → chunk-gy5rfgd4.js} +6 -6
- package/dist/{chunk-vrq6n6h1.js → chunk-gzsnwa2e.js} +2 -2
- package/dist/{chunk-4qqswajh.js → chunk-h2vxyvpa.js} +12 -14
- package/dist/{chunk-jebb8j1d.js → chunk-h9dtsc52.js} +51 -53
- package/dist/{chunk-nzpww4n5.js → chunk-hjr7tc1g.js} +1 -1
- package/dist/{chunk-hhwwyqt1.js → chunk-hkfat5cj.js} +50 -51
- package/dist/{chunk-9b77th8n.js → chunk-hkk80362.js} +1 -1
- package/dist/{chunk-fvr6n12m.js → chunk-hkqvtcn2.js} +1 -1
- package/dist/{chunk-nxa79974.js → chunk-hs7sxtea.js} +2 -2
- package/dist/{chunk-8ymf4e6z.js → chunk-hxc5rbra.js} +3 -3
- package/dist/{chunk-bmpwagz8.js → chunk-hz9ty6jz.js} +50 -51
- package/dist/{chunk-6kwx0aa4.js → chunk-hzk6nn1a.js} +47 -48
- package/dist/{chunk-b5hv2cbp.js → chunk-hzq56eee.js} +15 -15
- package/dist/{chunk-bt64sq5y.js → chunk-j04z48rw.js} +2 -2
- package/dist/chunk-j99epwtm.js +703 -0
- package/dist/{chunk-zs5b1dgr.js → chunk-jdq8jgyg.js} +1 -1
- package/dist/chunk-jdx93dh4.js +412 -0
- package/dist/chunk-jfqdw43z.js +14 -0
- package/dist/{chunk-ej1wwrcw.js → chunk-jvwa5w8w.js} +440 -654
- package/dist/{chunk-0w1sq2wh.js → chunk-jxzrapdr.js} +47 -48
- package/dist/{chunk-q76tj8p6.js → chunk-k7qqw0mj.js} +4 -4
- package/dist/{chunk-a8ejc632.js → chunk-k97s93n9.js} +1 -1
- package/dist/{chunk-sxaedgmw.js → chunk-kcewk85p.js} +2 -2
- package/dist/{chunk-5xbvemsj.js → chunk-kdbbs50z.js} +3 -3
- package/dist/{chunk-xmh281bd.js → chunk-ke0bvd5n.js} +48 -49
- package/dist/{chunk-3czpsqvd.js → chunk-kggr6n4m.js} +60 -63
- package/dist/{chunk-sfmxv59p.js → chunk-km3ssf62.js} +19 -19
- package/dist/{chunk-j1x3ns18.js → chunk-kmh848ar.js} +19 -19
- package/dist/{chunk-8k26yg8y.js → chunk-kmy230xj.js} +50 -51
- package/dist/{chunk-twmgrmfw.js → chunk-kpyj9z78.js} +1 -1
- package/dist/{chunk-s0d48jma.js → chunk-kwrep6kh.js} +2 -2
- package/dist/chunk-kxqjncxw.js +35 -0
- package/dist/{chunk-gfex5hb6.js → chunk-kyddexms.js} +13 -19
- package/dist/{chunk-sstfswx9.js → chunk-kyefv6ng.js} +16 -16
- package/dist/{chunk-2rdnvcex.js → chunk-kz44a3qf.js} +3 -3
- package/dist/{chunk-dy8tttdp.js → chunk-m0vj33nj.js} +3 -3
- package/dist/chunk-m2rg2m7x.js +910 -0
- package/dist/{chunk-mday155d.js → chunk-mbg1aw69.js} +10 -10
- package/dist/{chunk-h2ywbfms.js → chunk-mbkp0n55.js} +25 -25
- package/dist/{chunk-5cc4s826.js → chunk-mc41nrsy.js} +15 -15
- package/dist/{chunk-fbt6vctw.js → chunk-me5gz5wa.js} +14 -14
- package/dist/{chunk-gfs9md4a.js → chunk-mg8jtbwg.js} +50 -51
- package/dist/{chunk-r71sjhpf.js → chunk-mgkaqb94.js} +47 -48
- package/dist/{chunk-6s311f7t.js → chunk-mhygj95j.js} +48 -49
- package/dist/{chunk-xx1p336b.js → chunk-mjqazs3m.js} +2 -2
- package/dist/{chunk-sf0ay82k.js → chunk-mnfb10tx.js} +3 -3
- package/dist/{chunk-nwrtz4yt.js → chunk-mp72s5hc.js} +1 -1
- package/dist/{chunk-kzhw03m7.js → chunk-mp7bn9nx.js} +47 -48
- package/dist/{chunk-tzqx43zc.js → chunk-ms5agen7.js} +47 -48
- package/dist/{chunk-vs6r3az0.js → chunk-msehbnjp.js} +59 -60
- package/dist/{chunk-0mzj4pd6.js → chunk-my9dkgm8.js} +118 -4
- package/dist/{chunk-3jhddwfc.js → chunk-n7pwac8p.js} +15 -15
- package/dist/{chunk-kksbjtad.js → chunk-n8fxmey8.js} +1 -1
- package/dist/{chunk-tc1yyeaa.js → chunk-nd8hhtqz.js} +1 -1
- package/dist/{chunk-pyb8mk8k.js → chunk-nehajf9x.js} +3 -5
- package/dist/{chunk-fz0ch109.js → chunk-ng6s8w0e.js} +2 -2
- package/dist/{chunk-ry4ct8z8.js → chunk-ngryd7gy.js} +1 -1
- package/dist/{chunk-hbeg1qyg.js → chunk-nhxygcn1.js} +49 -50
- package/dist/chunk-nv7eb4pc.js +22 -0
- package/dist/{chunk-j84jdj7r.js → chunk-p6bws1a4.js} +16 -16
- package/dist/{chunk-y5x8wqe5.js → chunk-p8c4512d.js} +1 -1
- package/dist/{chunk-zt4jjf59.js → chunk-pa4m8fka.js} +14 -14
- package/dist/{chunk-4v58psnx.js → chunk-pd9q9fd7.js} +47 -48
- package/dist/chunk-pf1dekdv.js +26 -0
- package/dist/{chunk-9v303wbj.js → chunk-pj5wk9qe.js} +47 -48
- package/dist/{chunk-43v0vw9y.js → chunk-pkaehdm6.js} +859 -942
- package/dist/{chunk-fytzzgd4.js → chunk-pp4kq0fa.js} +47 -48
- package/dist/{chunk-1dnx9t9k.js → chunk-ptnf75rg.js} +47 -48
- package/dist/{chunk-wgwhgb0q.js → chunk-q09zbxk4.js} +15 -15
- package/dist/{chunk-ng8k4ywf.js → chunk-q1e46gk8.js} +55 -56
- package/dist/{chunk-n7gcwz03.js → chunk-q1e7t6tz.js} +15 -128
- package/dist/{chunk-exg8st0p.js → chunk-q2jeezb4.js} +3 -3
- package/dist/{chunk-865khv0s.js → chunk-q6vk37f0.js} +47 -48
- package/dist/chunk-q95b9wrd.js +40 -0
- package/dist/{chunk-75y4edzf.js → chunk-qcvyd3y4.js} +3 -3
- package/dist/{chunk-dx0wh311.js → chunk-qd97hcgd.js} +5 -5
- package/dist/{chunk-9r057b2r.js → chunk-qgx9mc6p.js} +5 -5
- package/dist/{chunk-jqr257x5.js → chunk-qkp3ytva.js} +108 -111
- package/dist/{chunk-ettyndhe.js → chunk-qkymv6n8.js} +6 -6
- package/dist/{chunk-rc5r5t8e.js → chunk-qrz3b0e1.js} +4 -4
- package/dist/{chunk-tmmjr5ta.js → chunk-qzjk4vpq.js} +4 -4
- package/dist/{chunk-hn3hk8tc.js → chunk-r35b43p4.js} +17 -17
- package/dist/{chunk-6gg2cvm2.js → chunk-r4j2h4yp.js} +1 -1
- package/dist/{chunk-p6q6twct.js → chunk-r651whr2.js} +15 -15
- package/dist/{chunk-wdz993z8.js → chunk-r70h7x48.js} +50 -51
- package/dist/{chunk-a9psh500.js → chunk-r8yzzrsp.js} +55 -56
- package/dist/{chunk-h1qt9p3c.js → chunk-rdgrfsjm.js} +47 -48
- package/dist/{chunk-65nwpf7n.js → chunk-rfmf8jw2.js} +1 -1
- package/dist/{chunk-m9e7stwq.js → chunk-rhdgt3c8.js} +4 -4
- package/dist/{chunk-1f59hhb4.js → chunk-rqwcz7mf.js} +16 -16
- package/dist/{chunk-73pxnrgv.js → chunk-rvb54w68.js} +2 -2
- package/dist/{chunk-4qv97nv2.js → chunk-rwa1xxqk.js} +4 -4
- package/dist/{chunk-aga3cvg8.js → chunk-s3k2jajp.js} +47 -48
- package/dist/{chunk-35bdpz91.js → chunk-s5cvaf0y.js} +3 -3
- package/dist/{chunk-13z0sgs1.js → chunk-s8tq4y70.js} +2 -2
- package/dist/{chunk-rmb338tt.js → chunk-sa2gzt2m.js} +2 -2
- package/dist/chunk-scyjb4rw.js +42 -0
- package/dist/{chunk-jk1arbw0.js → chunk-sfem4v24.js} +14 -14
- package/dist/{chunk-wbv06vv2.js → chunk-sjc21xag.js} +4 -4
- package/dist/{chunk-p12z0hqk.js → chunk-snkt46ca.js} +1 -1
- package/dist/{chunk-trj0ahk0.js → chunk-sqk9ayam.js} +5 -7
- package/dist/chunk-swjfjpja.js +3213 -0
- package/dist/{chunk-c7qxrffg.js → chunk-swyr0ze5.js} +5 -5
- package/dist/{chunk-sznnpxg3.js → chunk-t0rxmbvz.js} +17 -17
- package/dist/{chunk-eskw6xkv.js → chunk-t260g32y.js} +4 -4
- package/dist/{chunk-fg46hc6d.js → chunk-t6kym3nr.js} +38 -32
- package/dist/{chunk-5hjn2k7k.js → chunk-t79jmj3c.js} +5 -5
- package/dist/chunk-t7vqt78m.js +32 -0
- package/dist/chunk-t8sg0wf3.js +23 -0
- package/dist/{chunk-xdrgnnrx.js → chunk-tc92qnj1.js} +77 -50
- package/dist/{chunk-dd60e5wj.js → chunk-temv6q01.js} +4 -4
- package/dist/chunk-th1cykx3.js +494 -0
- package/dist/chunk-tp6bgx9r.js +90 -0
- package/dist/{chunk-smf3xf1p.js → chunk-tq61s8re.js} +48 -49
- package/dist/chunk-tsycknnm.js +887 -0
- package/dist/{chunk-0grvs3fk.js → chunk-tv3n7nyr.js} +47 -48
- package/dist/{chunk-ftfgv9wc.js → chunk-v3a3d8qr.js} +48 -49
- package/dist/{chunk-h83fz0gd.js → chunk-v6q8mas6.js} +48 -49
- package/dist/{chunk-9frfqse4.js → chunk-v9xtwnkn.js} +4 -4
- package/dist/{chunk-8fw7frqb.js → chunk-vecm4b7g.js} +1 -1
- package/dist/{chunk-35nbv64e.js → chunk-vhjrpmd7.js} +48 -49
- package/dist/{chunk-h2mr7m2a.js → chunk-vmp1tr7b.js} +2 -2
- package/dist/{chunk-zj3en2ka.js → chunk-vn9dpw7e.js} +50 -51
- package/dist/{chunk-qjxk8wrn.js → chunk-vnhhnca0.js} +1 -1
- package/dist/{chunk-y413jeq2.js → chunk-vqf0cwfx.js} +48 -49
- package/dist/chunk-vqm2wda9.js +46 -0
- package/dist/{chunk-045t7r98.js → chunk-vrbtdakb.js} +1 -1
- package/dist/{chunk-mk7e37ps.js → chunk-vrdp6hk3.js} +50 -51
- package/dist/{chunk-jgf7597r.js → chunk-vzn6172q.js} +56 -58
- package/dist/chunk-w0b04y7r.js +609 -0
- package/dist/{chunk-ckw2286k.js → chunk-w20437bg.js} +47 -48
- package/dist/{chunk-1ed27xte.js → chunk-w54rzd0a.js} +50 -51
- package/dist/{chunk-8fttwfkm.js → chunk-w7eccwbe.js} +15 -15
- package/dist/{chunk-1e3vcw6m.js → chunk-wa3arctj.js} +12 -12
- package/dist/{chunk-yt46a969.js → chunk-wa7rnp49.js} +1 -1
- package/dist/{chunk-1j57r4bp.js → chunk-waazrpce.js} +2 -2
- package/dist/{chunk-wny26e8e.js → chunk-wbh9ydpk.js} +19 -19
- package/dist/{chunk-w6k4bxas.js → chunk-wc7s61fq.js} +15 -15
- package/dist/{chunk-tjqcyj2x.js → chunk-wgmkhbe4.js} +2 -2
- package/dist/{chunk-k80dnb78.js → chunk-wh23fnfe.js} +11 -11
- package/dist/{chunk-pkm2nhk9.js → chunk-whvpa72n.js} +4 -4
- package/dist/chunk-wkyyghn6.js +184 -0
- package/dist/{chunk-ebnp9s5b.js → chunk-wngtt6cw.js} +2 -2
- package/dist/chunk-wp35dfwp.js +15 -0
- package/dist/{chunk-6gr3c3w9.js → chunk-wpqynh28.js} +2 -2
- package/dist/{chunk-tv7hgcvj.js → chunk-wtje1bzc.js} +48 -49
- package/dist/{chunk-w375z6hb.js → chunk-wwjb9kpr.js} +48 -49
- package/dist/{chunk-y6f7kmzf.js → chunk-wzarjbqs.js} +47 -48
- package/dist/{chunk-9b0yx2w5.js → chunk-wzyspdkz.js} +54 -55
- package/dist/chunk-x3atm9a1.js +864 -0
- package/dist/{chunk-rkmwx1yz.js → chunk-x52qkhng.js} +1 -1
- package/dist/{chunk-m737wsqq.js → chunk-xpecr6a1.js} +5 -7
- package/dist/{chunk-3e41bc8q.js → chunk-xt3x0wrj.js} +1 -1
- package/dist/{chunk-25bv0psg.js → chunk-xvwv91w4.js} +47 -48
- package/dist/{chunk-8c32awe2.js → chunk-xwh3q911.js} +2 -2
- package/dist/{chunk-vcctr6md.js → chunk-xydbqr0b.js} +47 -48
- package/dist/{chunk-dpwxnzqj.js → chunk-xzmas4y8.js} +47 -48
- package/dist/{chunk-p814dt75.js → chunk-y4dgbkb3.js} +290 -261
- package/dist/{chunk-2f1f034j.js → chunk-y5phkfvf.js} +3 -3
- package/dist/{chunk-k1af22na.js → chunk-y689dg14.js} +14 -14
- package/dist/{chunk-qdx64b6y.js → chunk-yevw8ttf.js} +15 -15
- package/dist/{chunk-jpk1syr5.js → chunk-yhqcnq80.js} +50 -51
- package/dist/{chunk-zcn4zxbj.js → chunk-yk4t7kxm.js} +1 -1
- package/dist/{chunk-7r2k7qes.js → chunk-ykbz8f85.js} +3 -3
- package/dist/{chunk-h3p151fx.js → chunk-ykcqa4mj.js} +1 -1
- package/dist/{chunk-d90bhmt1.js → chunk-ysj2gfxe.js} +48 -47
- package/dist/{chunk-6cj8bg38.js → chunk-z51fyxdw.js} +55 -56
- package/dist/{chunk-j52vz59d.js → chunk-z86pzxdm.js} +48 -49
- package/dist/chunk-z88f5181.js +258 -0
- package/dist/{chunk-8epxe23k.js → chunk-zd6w7gc2.js} +5 -5
- package/dist/{chunk-ebrc3yf3.js → chunk-zv0txvbs.js} +4 -4
- package/dist/{chunk-196500e9.js → chunk-zvkkjep6.js} +12 -12
- package/dist/{chunk-j66ffy26.js → chunk-zx2xx5ek.js} +20 -20
- package/dist/{chunk-trt2sfjg.js → chunk-zzz4ny7p.js} +1 -1
- package/dist/cli.js +24 -24
- package/package.json +29 -28
- package/scripts/run-parallel.mjs +10 -0
- package/dist/chunk-0mf8c3kx.js +0 -8
- package/dist/chunk-40k3k0bt.js +0 -68
- package/dist/chunk-6c5zyga7.js +0 -12
- package/dist/chunk-c79brdh8.js +0 -186
- package/dist/chunk-h6hh3va9.js +0 -946
- package/dist/chunk-jnhp78c8.js +0 -47
- package/dist/chunk-k97ze3a8.js +0 -524
- package/dist/chunk-m4sp7ycd.js +0 -53
- package/dist/chunk-vk6s7hsj.js +0 -159
- package/dist/download-ripgrep.js +0 -24837
- package/dist/{chunk-y3jmpqat.js → chunk-5vdpbk46.js} +3 -3
- package/dist/{chunk-vest0y6x.js → chunk-6h6kzvyd.js} +3 -3
- package/dist/{chunk-f5ma3nh5.js → chunk-7a31vc3r.js} +0 -0
- package/dist/{chunk-tbas522c.js → chunk-ftbf37y7.js} +1 -1
- package/dist/{chunk-pfgwfg55.js → chunk-xexnht94.js} +3 -3
- package/dist/{chunk-0fnpkgd6.js → chunk-ybebarb1.js} +10 -10
|
@@ -0,0 +1,1731 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import {
|
|
3
|
+
__commonJS,
|
|
4
|
+
__require
|
|
5
|
+
} from "./chunk-qp2qdcda.js";
|
|
6
|
+
|
|
7
|
+
// node_modules/.bun/@smithy+util-body-length-node@4.2.3/node_modules/@smithy/util-body-length-node/dist-cjs/index.js
|
|
8
|
+
var require_dist_cjs = __commonJS((exports) => {
|
|
9
|
+
var node_fs = __require("fs");
|
|
10
|
+
var calculateBodyLength = (body) => {
|
|
11
|
+
if (!body) {
|
|
12
|
+
return 0;
|
|
13
|
+
}
|
|
14
|
+
if (typeof body === "string") {
|
|
15
|
+
return Buffer.byteLength(body);
|
|
16
|
+
} else if (typeof body.byteLength === "number") {
|
|
17
|
+
return body.byteLength;
|
|
18
|
+
} else if (typeof body.size === "number") {
|
|
19
|
+
return body.size;
|
|
20
|
+
} else if (typeof body.start === "number" && typeof body.end === "number") {
|
|
21
|
+
return body.end + 1 - body.start;
|
|
22
|
+
} else if (body instanceof node_fs.ReadStream) {
|
|
23
|
+
if (body.path != null) {
|
|
24
|
+
return node_fs.lstatSync(body.path).size;
|
|
25
|
+
} else if (typeof body.fd === "number") {
|
|
26
|
+
return node_fs.fstatSync(body.fd).size;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
throw new Error(`Body Length computation failed for ${body}`);
|
|
30
|
+
};
|
|
31
|
+
exports.calculateBodyLength = calculateBodyLength;
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
// node_modules/.bun/@aws+lambda-invoke-store@0.2.4/node_modules/@aws/lambda-invoke-store/dist-cjs/invoke-store.js
|
|
35
|
+
var require_invoke_store = __commonJS((exports) => {
|
|
36
|
+
var PROTECTED_KEYS = {
|
|
37
|
+
REQUEST_ID: Symbol.for("_AWS_LAMBDA_REQUEST_ID"),
|
|
38
|
+
X_RAY_TRACE_ID: Symbol.for("_AWS_LAMBDA_X_RAY_TRACE_ID"),
|
|
39
|
+
TENANT_ID: Symbol.for("_AWS_LAMBDA_TENANT_ID")
|
|
40
|
+
};
|
|
41
|
+
var NO_GLOBAL_AWS_LAMBDA = ["true", "1"].includes(process.env?.AWS_LAMBDA_NODEJS_NO_GLOBAL_AWSLAMBDA ?? "");
|
|
42
|
+
if (!NO_GLOBAL_AWS_LAMBDA) {
|
|
43
|
+
globalThis.awslambda = globalThis.awslambda || {};
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
class InvokeStoreBase {
|
|
47
|
+
static PROTECTED_KEYS = PROTECTED_KEYS;
|
|
48
|
+
isProtectedKey(key) {
|
|
49
|
+
return Object.values(PROTECTED_KEYS).includes(key);
|
|
50
|
+
}
|
|
51
|
+
getRequestId() {
|
|
52
|
+
return this.get(PROTECTED_KEYS.REQUEST_ID) ?? "-";
|
|
53
|
+
}
|
|
54
|
+
getXRayTraceId() {
|
|
55
|
+
return this.get(PROTECTED_KEYS.X_RAY_TRACE_ID);
|
|
56
|
+
}
|
|
57
|
+
getTenantId() {
|
|
58
|
+
return this.get(PROTECTED_KEYS.TENANT_ID);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
class InvokeStoreSingle extends InvokeStoreBase {
|
|
63
|
+
currentContext;
|
|
64
|
+
getContext() {
|
|
65
|
+
return this.currentContext;
|
|
66
|
+
}
|
|
67
|
+
hasContext() {
|
|
68
|
+
return this.currentContext !== undefined;
|
|
69
|
+
}
|
|
70
|
+
get(key) {
|
|
71
|
+
return this.currentContext?.[key];
|
|
72
|
+
}
|
|
73
|
+
set(key, value) {
|
|
74
|
+
if (this.isProtectedKey(key)) {
|
|
75
|
+
throw new Error(`Cannot modify protected Lambda context field: ${String(key)}`);
|
|
76
|
+
}
|
|
77
|
+
this.currentContext = this.currentContext || {};
|
|
78
|
+
this.currentContext[key] = value;
|
|
79
|
+
}
|
|
80
|
+
run(context, fn) {
|
|
81
|
+
this.currentContext = context;
|
|
82
|
+
return fn();
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
class InvokeStoreMulti extends InvokeStoreBase {
|
|
87
|
+
als;
|
|
88
|
+
static async create() {
|
|
89
|
+
const instance = new InvokeStoreMulti;
|
|
90
|
+
const asyncHooks = await import("async_hooks");
|
|
91
|
+
instance.als = new asyncHooks.AsyncLocalStorage;
|
|
92
|
+
return instance;
|
|
93
|
+
}
|
|
94
|
+
getContext() {
|
|
95
|
+
return this.als.getStore();
|
|
96
|
+
}
|
|
97
|
+
hasContext() {
|
|
98
|
+
return this.als.getStore() !== undefined;
|
|
99
|
+
}
|
|
100
|
+
get(key) {
|
|
101
|
+
return this.als.getStore()?.[key];
|
|
102
|
+
}
|
|
103
|
+
set(key, value) {
|
|
104
|
+
if (this.isProtectedKey(key)) {
|
|
105
|
+
throw new Error(`Cannot modify protected Lambda context field: ${String(key)}`);
|
|
106
|
+
}
|
|
107
|
+
const store = this.als.getStore();
|
|
108
|
+
if (!store) {
|
|
109
|
+
throw new Error("No context available");
|
|
110
|
+
}
|
|
111
|
+
store[key] = value;
|
|
112
|
+
}
|
|
113
|
+
run(context, fn) {
|
|
114
|
+
return this.als.run(context, fn);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
exports.InvokeStore = undefined;
|
|
118
|
+
(function(InvokeStore) {
|
|
119
|
+
let instance = null;
|
|
120
|
+
async function getInstanceAsync(forceInvokeStoreMulti) {
|
|
121
|
+
if (!instance) {
|
|
122
|
+
instance = (async () => {
|
|
123
|
+
const isMulti = forceInvokeStoreMulti === true || "AWS_LAMBDA_MAX_CONCURRENCY" in process.env;
|
|
124
|
+
const newInstance = isMulti ? await InvokeStoreMulti.create() : new InvokeStoreSingle;
|
|
125
|
+
if (!NO_GLOBAL_AWS_LAMBDA && globalThis.awslambda?.InvokeStore) {
|
|
126
|
+
return globalThis.awslambda.InvokeStore;
|
|
127
|
+
} else if (!NO_GLOBAL_AWS_LAMBDA && globalThis.awslambda) {
|
|
128
|
+
globalThis.awslambda.InvokeStore = newInstance;
|
|
129
|
+
return newInstance;
|
|
130
|
+
} else {
|
|
131
|
+
return newInstance;
|
|
132
|
+
}
|
|
133
|
+
})();
|
|
134
|
+
}
|
|
135
|
+
return instance;
|
|
136
|
+
}
|
|
137
|
+
InvokeStore.getInstanceAsync = getInstanceAsync;
|
|
138
|
+
InvokeStore._testing = process.env.AWS_LAMBDA_BENCHMARK_MODE === "1" ? {
|
|
139
|
+
reset: () => {
|
|
140
|
+
instance = null;
|
|
141
|
+
if (globalThis.awslambda?.InvokeStore) {
|
|
142
|
+
delete globalThis.awslambda.InvokeStore;
|
|
143
|
+
}
|
|
144
|
+
globalThis.awslambda = { InvokeStore: undefined };
|
|
145
|
+
}
|
|
146
|
+
} : undefined;
|
|
147
|
+
})(exports.InvokeStore || (exports.InvokeStore = {}));
|
|
148
|
+
exports.InvokeStoreBase = InvokeStoreBase;
|
|
149
|
+
});
|
|
150
|
+
|
|
151
|
+
// node_modules/.bun/@smithy+util-body-length-browser@4.2.2/node_modules/@smithy/util-body-length-browser/dist-cjs/index.js
|
|
152
|
+
var require_dist_cjs2 = __commonJS((exports) => {
|
|
153
|
+
var TEXT_ENCODER = typeof TextEncoder == "function" ? new TextEncoder : null;
|
|
154
|
+
var calculateBodyLength = (body) => {
|
|
155
|
+
if (typeof body === "string") {
|
|
156
|
+
if (TEXT_ENCODER) {
|
|
157
|
+
return TEXT_ENCODER.encode(body).byteLength;
|
|
158
|
+
}
|
|
159
|
+
let len = body.length;
|
|
160
|
+
for (let i = len - 1;i >= 0; i--) {
|
|
161
|
+
const code = body.charCodeAt(i);
|
|
162
|
+
if (code > 127 && code <= 2047)
|
|
163
|
+
len++;
|
|
164
|
+
else if (code > 2047 && code <= 65535)
|
|
165
|
+
len += 2;
|
|
166
|
+
if (code >= 56320 && code <= 57343)
|
|
167
|
+
i--;
|
|
168
|
+
}
|
|
169
|
+
return len;
|
|
170
|
+
} else if (typeof body.byteLength === "number") {
|
|
171
|
+
return body.byteLength;
|
|
172
|
+
} else if (typeof body.size === "number") {
|
|
173
|
+
return body.size;
|
|
174
|
+
}
|
|
175
|
+
throw new Error(`Body Length computation failed for ${body}`);
|
|
176
|
+
};
|
|
177
|
+
exports.calculateBodyLength = calculateBodyLength;
|
|
178
|
+
});
|
|
179
|
+
|
|
180
|
+
// node_modules/.bun/fast-xml-parser@5.5.8/node_modules/fast-xml-parser/lib/fxp.cjs
|
|
181
|
+
var require_fxp = __commonJS((exports, module) => {
|
|
182
|
+
(() => {
|
|
183
|
+
var t = { d: (e2, i2) => {
|
|
184
|
+
for (var n2 in i2)
|
|
185
|
+
t.o(i2, n2) && !t.o(e2, n2) && Object.defineProperty(e2, n2, { enumerable: true, get: i2[n2] });
|
|
186
|
+
}, o: (t2, e2) => Object.prototype.hasOwnProperty.call(t2, e2), r: (t2) => {
|
|
187
|
+
typeof Symbol != "undefined" && Symbol.toStringTag && Object.defineProperty(t2, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(t2, "__esModule", { value: true });
|
|
188
|
+
} }, e = {};
|
|
189
|
+
t.r(e), t.d(e, { XMLBuilder: () => $t, XMLParser: () => gt, XMLValidator: () => It });
|
|
190
|
+
const i = ":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD", n = new RegExp("^[" + i + "][" + i + "\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$");
|
|
191
|
+
function s(t2, e2) {
|
|
192
|
+
const i2 = [];
|
|
193
|
+
let n2 = e2.exec(t2);
|
|
194
|
+
for (;n2; ) {
|
|
195
|
+
const s2 = [];
|
|
196
|
+
s2.startIndex = e2.lastIndex - n2[0].length;
|
|
197
|
+
const r2 = n2.length;
|
|
198
|
+
for (let t3 = 0;t3 < r2; t3++)
|
|
199
|
+
s2.push(n2[t3]);
|
|
200
|
+
i2.push(s2), n2 = e2.exec(t2);
|
|
201
|
+
}
|
|
202
|
+
return i2;
|
|
203
|
+
}
|
|
204
|
+
const r = function(t2) {
|
|
205
|
+
return !(n.exec(t2) == null);
|
|
206
|
+
}, o = ["hasOwnProperty", "toString", "valueOf", "__defineGetter__", "__defineSetter__", "__lookupGetter__", "__lookupSetter__"], a = ["__proto__", "constructor", "prototype"], h = { allowBooleanAttributes: false, unpairedTags: [] };
|
|
207
|
+
function l(t2, e2) {
|
|
208
|
+
e2 = Object.assign({}, h, e2);
|
|
209
|
+
const i2 = [];
|
|
210
|
+
let n2 = false, s2 = false;
|
|
211
|
+
t2[0] === "\uFEFF" && (t2 = t2.substr(1));
|
|
212
|
+
for (let r2 = 0;r2 < t2.length; r2++)
|
|
213
|
+
if (t2[r2] === "<" && t2[r2 + 1] === "?") {
|
|
214
|
+
if (r2 += 2, r2 = u(t2, r2), r2.err)
|
|
215
|
+
return r2;
|
|
216
|
+
} else {
|
|
217
|
+
if (t2[r2] !== "<") {
|
|
218
|
+
if (p(t2[r2]))
|
|
219
|
+
continue;
|
|
220
|
+
return b("InvalidChar", "char '" + t2[r2] + "' is not expected.", w(t2, r2));
|
|
221
|
+
}
|
|
222
|
+
{
|
|
223
|
+
let o2 = r2;
|
|
224
|
+
if (r2++, t2[r2] === "!") {
|
|
225
|
+
r2 = c(t2, r2);
|
|
226
|
+
continue;
|
|
227
|
+
}
|
|
228
|
+
{
|
|
229
|
+
let a2 = false;
|
|
230
|
+
t2[r2] === "/" && (a2 = true, r2++);
|
|
231
|
+
let h2 = "";
|
|
232
|
+
for (;r2 < t2.length && t2[r2] !== ">" && t2[r2] !== " " && t2[r2] !== "\t" && t2[r2] !== `
|
|
233
|
+
` && t2[r2] !== "\r"; r2++)
|
|
234
|
+
h2 += t2[r2];
|
|
235
|
+
if (h2 = h2.trim(), h2[h2.length - 1] === "/" && (h2 = h2.substring(0, h2.length - 1), r2--), !y(h2)) {
|
|
236
|
+
let e3;
|
|
237
|
+
return e3 = h2.trim().length === 0 ? "Invalid space after '<'." : "Tag '" + h2 + "' is an invalid name.", b("InvalidTag", e3, w(t2, r2));
|
|
238
|
+
}
|
|
239
|
+
const l2 = g(t2, r2);
|
|
240
|
+
if (l2 === false)
|
|
241
|
+
return b("InvalidAttr", "Attributes for '" + h2 + "' have open quote.", w(t2, r2));
|
|
242
|
+
let d2 = l2.value;
|
|
243
|
+
if (r2 = l2.index, d2[d2.length - 1] === "/") {
|
|
244
|
+
const i3 = r2 - d2.length;
|
|
245
|
+
d2 = d2.substring(0, d2.length - 1);
|
|
246
|
+
const s3 = x(d2, e2);
|
|
247
|
+
if (s3 !== true)
|
|
248
|
+
return b(s3.err.code, s3.err.msg, w(t2, i3 + s3.err.line));
|
|
249
|
+
n2 = true;
|
|
250
|
+
} else if (a2) {
|
|
251
|
+
if (!l2.tagClosed)
|
|
252
|
+
return b("InvalidTag", "Closing tag '" + h2 + "' doesn't have proper closing.", w(t2, r2));
|
|
253
|
+
if (d2.trim().length > 0)
|
|
254
|
+
return b("InvalidTag", "Closing tag '" + h2 + "' can't have attributes or invalid starting.", w(t2, o2));
|
|
255
|
+
if (i2.length === 0)
|
|
256
|
+
return b("InvalidTag", "Closing tag '" + h2 + "' has not been opened.", w(t2, o2));
|
|
257
|
+
{
|
|
258
|
+
const e3 = i2.pop();
|
|
259
|
+
if (h2 !== e3.tagName) {
|
|
260
|
+
let i3 = w(t2, e3.tagStartPos);
|
|
261
|
+
return b("InvalidTag", "Expected closing tag '" + e3.tagName + "' (opened in line " + i3.line + ", col " + i3.col + ") instead of closing tag '" + h2 + "'.", w(t2, o2));
|
|
262
|
+
}
|
|
263
|
+
i2.length == 0 && (s2 = true);
|
|
264
|
+
}
|
|
265
|
+
} else {
|
|
266
|
+
const a3 = x(d2, e2);
|
|
267
|
+
if (a3 !== true)
|
|
268
|
+
return b(a3.err.code, a3.err.msg, w(t2, r2 - d2.length + a3.err.line));
|
|
269
|
+
if (s2 === true)
|
|
270
|
+
return b("InvalidXml", "Multiple possible root nodes found.", w(t2, r2));
|
|
271
|
+
e2.unpairedTags.indexOf(h2) !== -1 || i2.push({ tagName: h2, tagStartPos: o2 }), n2 = true;
|
|
272
|
+
}
|
|
273
|
+
for (r2++;r2 < t2.length; r2++)
|
|
274
|
+
if (t2[r2] === "<") {
|
|
275
|
+
if (t2[r2 + 1] === "!") {
|
|
276
|
+
r2++, r2 = c(t2, r2);
|
|
277
|
+
continue;
|
|
278
|
+
}
|
|
279
|
+
if (t2[r2 + 1] !== "?")
|
|
280
|
+
break;
|
|
281
|
+
if (r2 = u(t2, ++r2), r2.err)
|
|
282
|
+
return r2;
|
|
283
|
+
} else if (t2[r2] === "&") {
|
|
284
|
+
const e3 = N(t2, r2);
|
|
285
|
+
if (e3 == -1)
|
|
286
|
+
return b("InvalidChar", "char '&' is not expected.", w(t2, r2));
|
|
287
|
+
r2 = e3;
|
|
288
|
+
} else if (s2 === true && !p(t2[r2]))
|
|
289
|
+
return b("InvalidXml", "Extra text at the end", w(t2, r2));
|
|
290
|
+
t2[r2] === "<" && r2--;
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
return n2 ? i2.length == 1 ? b("InvalidTag", "Unclosed tag '" + i2[0].tagName + "'.", w(t2, i2[0].tagStartPos)) : !(i2.length > 0) || b("InvalidXml", "Invalid '" + JSON.stringify(i2.map((t3) => t3.tagName), null, 4).replace(/\r?\n/g, "") + "' found.", { line: 1, col: 1 }) : b("InvalidXml", "Start tag expected.", 1);
|
|
295
|
+
}
|
|
296
|
+
function p(t2) {
|
|
297
|
+
return t2 === " " || t2 === "\t" || t2 === `
|
|
298
|
+
` || t2 === "\r";
|
|
299
|
+
}
|
|
300
|
+
function u(t2, e2) {
|
|
301
|
+
const i2 = e2;
|
|
302
|
+
for (;e2 < t2.length; e2++)
|
|
303
|
+
if (t2[e2] == "?" || t2[e2] == " ") {
|
|
304
|
+
const n2 = t2.substr(i2, e2 - i2);
|
|
305
|
+
if (e2 > 5 && n2 === "xml")
|
|
306
|
+
return b("InvalidXml", "XML declaration allowed only at the start of the document.", w(t2, e2));
|
|
307
|
+
if (t2[e2] == "?" && t2[e2 + 1] == ">") {
|
|
308
|
+
e2++;
|
|
309
|
+
break;
|
|
310
|
+
}
|
|
311
|
+
continue;
|
|
312
|
+
}
|
|
313
|
+
return e2;
|
|
314
|
+
}
|
|
315
|
+
function c(t2, e2) {
|
|
316
|
+
if (t2.length > e2 + 5 && t2[e2 + 1] === "-" && t2[e2 + 2] === "-") {
|
|
317
|
+
for (e2 += 3;e2 < t2.length; e2++)
|
|
318
|
+
if (t2[e2] === "-" && t2[e2 + 1] === "-" && t2[e2 + 2] === ">") {
|
|
319
|
+
e2 += 2;
|
|
320
|
+
break;
|
|
321
|
+
}
|
|
322
|
+
} else if (t2.length > e2 + 8 && t2[e2 + 1] === "D" && t2[e2 + 2] === "O" && t2[e2 + 3] === "C" && t2[e2 + 4] === "T" && t2[e2 + 5] === "Y" && t2[e2 + 6] === "P" && t2[e2 + 7] === "E") {
|
|
323
|
+
let i2 = 1;
|
|
324
|
+
for (e2 += 8;e2 < t2.length; e2++)
|
|
325
|
+
if (t2[e2] === "<")
|
|
326
|
+
i2++;
|
|
327
|
+
else if (t2[e2] === ">" && (i2--, i2 === 0))
|
|
328
|
+
break;
|
|
329
|
+
} else if (t2.length > e2 + 9 && t2[e2 + 1] === "[" && t2[e2 + 2] === "C" && t2[e2 + 3] === "D" && t2[e2 + 4] === "A" && t2[e2 + 5] === "T" && t2[e2 + 6] === "A" && t2[e2 + 7] === "[") {
|
|
330
|
+
for (e2 += 8;e2 < t2.length; e2++)
|
|
331
|
+
if (t2[e2] === "]" && t2[e2 + 1] === "]" && t2[e2 + 2] === ">") {
|
|
332
|
+
e2 += 2;
|
|
333
|
+
break;
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
return e2;
|
|
337
|
+
}
|
|
338
|
+
const d = '"', f = "'";
|
|
339
|
+
function g(t2, e2) {
|
|
340
|
+
let i2 = "", n2 = "", s2 = false;
|
|
341
|
+
for (;e2 < t2.length; e2++) {
|
|
342
|
+
if (t2[e2] === d || t2[e2] === f)
|
|
343
|
+
n2 === "" ? n2 = t2[e2] : n2 !== t2[e2] || (n2 = "");
|
|
344
|
+
else if (t2[e2] === ">" && n2 === "") {
|
|
345
|
+
s2 = true;
|
|
346
|
+
break;
|
|
347
|
+
}
|
|
348
|
+
i2 += t2[e2];
|
|
349
|
+
}
|
|
350
|
+
return n2 === "" && { value: i2, index: e2, tagClosed: s2 };
|
|
351
|
+
}
|
|
352
|
+
const m = new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`, "g");
|
|
353
|
+
function x(t2, e2) {
|
|
354
|
+
const i2 = s(t2, m), n2 = {};
|
|
355
|
+
for (let t3 = 0;t3 < i2.length; t3++) {
|
|
356
|
+
if (i2[t3][1].length === 0)
|
|
357
|
+
return b("InvalidAttr", "Attribute '" + i2[t3][2] + "' has no space in starting.", v(i2[t3]));
|
|
358
|
+
if (i2[t3][3] !== undefined && i2[t3][4] === undefined)
|
|
359
|
+
return b("InvalidAttr", "Attribute '" + i2[t3][2] + "' is without value.", v(i2[t3]));
|
|
360
|
+
if (i2[t3][3] === undefined && !e2.allowBooleanAttributes)
|
|
361
|
+
return b("InvalidAttr", "boolean attribute '" + i2[t3][2] + "' is not allowed.", v(i2[t3]));
|
|
362
|
+
const s2 = i2[t3][2];
|
|
363
|
+
if (!E(s2))
|
|
364
|
+
return b("InvalidAttr", "Attribute '" + s2 + "' is an invalid name.", v(i2[t3]));
|
|
365
|
+
if (Object.prototype.hasOwnProperty.call(n2, s2))
|
|
366
|
+
return b("InvalidAttr", "Attribute '" + s2 + "' is repeated.", v(i2[t3]));
|
|
367
|
+
n2[s2] = 1;
|
|
368
|
+
}
|
|
369
|
+
return true;
|
|
370
|
+
}
|
|
371
|
+
function N(t2, e2) {
|
|
372
|
+
if (t2[++e2] === ";")
|
|
373
|
+
return -1;
|
|
374
|
+
if (t2[e2] === "#")
|
|
375
|
+
return function(t3, e3) {
|
|
376
|
+
let i3 = /\d/;
|
|
377
|
+
for (t3[e3] === "x" && (e3++, i3 = /[\da-fA-F]/);e3 < t3.length; e3++) {
|
|
378
|
+
if (t3[e3] === ";")
|
|
379
|
+
return e3;
|
|
380
|
+
if (!t3[e3].match(i3))
|
|
381
|
+
break;
|
|
382
|
+
}
|
|
383
|
+
return -1;
|
|
384
|
+
}(t2, ++e2);
|
|
385
|
+
let i2 = 0;
|
|
386
|
+
for (;e2 < t2.length; e2++, i2++)
|
|
387
|
+
if (!(t2[e2].match(/\w/) && i2 < 20)) {
|
|
388
|
+
if (t2[e2] === ";")
|
|
389
|
+
break;
|
|
390
|
+
return -1;
|
|
391
|
+
}
|
|
392
|
+
return e2;
|
|
393
|
+
}
|
|
394
|
+
function b(t2, e2, i2) {
|
|
395
|
+
return { err: { code: t2, msg: e2, line: i2.line || i2, col: i2.col } };
|
|
396
|
+
}
|
|
397
|
+
function E(t2) {
|
|
398
|
+
return r(t2);
|
|
399
|
+
}
|
|
400
|
+
function y(t2) {
|
|
401
|
+
return r(t2);
|
|
402
|
+
}
|
|
403
|
+
function w(t2, e2) {
|
|
404
|
+
const i2 = t2.substring(0, e2).split(/\r?\n/);
|
|
405
|
+
return { line: i2.length, col: i2[i2.length - 1].length + 1 };
|
|
406
|
+
}
|
|
407
|
+
function v(t2) {
|
|
408
|
+
return t2.startIndex + t2[1].length;
|
|
409
|
+
}
|
|
410
|
+
const T = (t2) => o.includes(t2) ? "__" + t2 : t2, P = { preserveOrder: false, attributeNamePrefix: "@_", attributesGroupName: false, textNodeName: "#text", ignoreAttributes: true, removeNSPrefix: false, allowBooleanAttributes: false, parseTagValue: true, parseAttributeValue: false, trimValues: true, cdataPropName: false, numberParseOptions: { hex: true, leadingZeros: true, eNotation: true }, tagValueProcessor: function(t2, e2) {
|
|
411
|
+
return e2;
|
|
412
|
+
}, attributeValueProcessor: function(t2, e2) {
|
|
413
|
+
return e2;
|
|
414
|
+
}, stopNodes: [], alwaysCreateTextNode: false, isArray: () => false, commentPropName: false, unpairedTags: [], processEntities: true, htmlEntities: false, ignoreDeclaration: false, ignorePiTags: false, transformTagName: false, transformAttributeName: false, updateTag: function(t2, e2, i2) {
|
|
415
|
+
return t2;
|
|
416
|
+
}, captureMetaData: false, maxNestedTags: 100, strictReservedNames: true, jPath: true, onDangerousProperty: T };
|
|
417
|
+
function S(t2, e2) {
|
|
418
|
+
if (typeof t2 != "string")
|
|
419
|
+
return;
|
|
420
|
+
const i2 = t2.toLowerCase();
|
|
421
|
+
if (o.some((t3) => i2 === t3.toLowerCase()))
|
|
422
|
+
throw new Error(`[SECURITY] Invalid ${e2}: "${t2}" is a reserved JavaScript keyword that could cause prototype pollution`);
|
|
423
|
+
if (a.some((t3) => i2 === t3.toLowerCase()))
|
|
424
|
+
throw new Error(`[SECURITY] Invalid ${e2}: "${t2}" is a reserved JavaScript keyword that could cause prototype pollution`);
|
|
425
|
+
}
|
|
426
|
+
function A(t2) {
|
|
427
|
+
return typeof t2 == "boolean" ? { enabled: t2, maxEntitySize: 1e4, maxExpansionDepth: 10, maxTotalExpansions: 1000, maxExpandedLength: 1e5, maxEntityCount: 100, allowedTags: null, tagFilter: null } : typeof t2 == "object" && t2 !== null ? { enabled: t2.enabled !== false, maxEntitySize: Math.max(1, t2.maxEntitySize ?? 1e4), maxExpansionDepth: Math.max(1, t2.maxExpansionDepth ?? 10), maxTotalExpansions: Math.max(1, t2.maxTotalExpansions ?? 1000), maxExpandedLength: Math.max(1, t2.maxExpandedLength ?? 1e5), maxEntityCount: Math.max(1, t2.maxEntityCount ?? 100), allowedTags: t2.allowedTags ?? null, tagFilter: t2.tagFilter ?? null } : A(true);
|
|
428
|
+
}
|
|
429
|
+
const O = function(t2) {
|
|
430
|
+
const e2 = Object.assign({}, P, t2), i2 = [{ value: e2.attributeNamePrefix, name: "attributeNamePrefix" }, { value: e2.attributesGroupName, name: "attributesGroupName" }, { value: e2.textNodeName, name: "textNodeName" }, { value: e2.cdataPropName, name: "cdataPropName" }, { value: e2.commentPropName, name: "commentPropName" }];
|
|
431
|
+
for (const { value: t3, name: e3 } of i2)
|
|
432
|
+
t3 && S(t3, e3);
|
|
433
|
+
return e2.onDangerousProperty === null && (e2.onDangerousProperty = T), e2.processEntities = A(e2.processEntities), e2.stopNodes && Array.isArray(e2.stopNodes) && (e2.stopNodes = e2.stopNodes.map((t3) => typeof t3 == "string" && t3.startsWith("*.") ? ".." + t3.substring(2) : t3)), e2;
|
|
434
|
+
};
|
|
435
|
+
let C;
|
|
436
|
+
C = typeof Symbol != "function" ? "@@xmlMetadata" : Symbol("XML Node Metadata");
|
|
437
|
+
|
|
438
|
+
class $ {
|
|
439
|
+
constructor(t2) {
|
|
440
|
+
this.tagname = t2, this.child = [], this[":@"] = Object.create(null);
|
|
441
|
+
}
|
|
442
|
+
add(t2, e2) {
|
|
443
|
+
t2 === "__proto__" && (t2 = "#__proto__"), this.child.push({ [t2]: e2 });
|
|
444
|
+
}
|
|
445
|
+
addChild(t2, e2) {
|
|
446
|
+
t2.tagname === "__proto__" && (t2.tagname = "#__proto__"), t2[":@"] && Object.keys(t2[":@"]).length > 0 ? this.child.push({ [t2.tagname]: t2.child, ":@": t2[":@"] }) : this.child.push({ [t2.tagname]: t2.child }), e2 !== undefined && (this.child[this.child.length - 1][C] = { startIndex: e2 });
|
|
447
|
+
}
|
|
448
|
+
static getMetaDataSymbol() {
|
|
449
|
+
return C;
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
class I {
|
|
454
|
+
constructor(t2) {
|
|
455
|
+
this.suppressValidationErr = !t2, this.options = t2;
|
|
456
|
+
}
|
|
457
|
+
readDocType(t2, e2) {
|
|
458
|
+
const i2 = Object.create(null);
|
|
459
|
+
let n2 = 0;
|
|
460
|
+
if (t2[e2 + 3] !== "O" || t2[e2 + 4] !== "C" || t2[e2 + 5] !== "T" || t2[e2 + 6] !== "Y" || t2[e2 + 7] !== "P" || t2[e2 + 8] !== "E")
|
|
461
|
+
throw new Error("Invalid Tag instead of DOCTYPE");
|
|
462
|
+
{
|
|
463
|
+
e2 += 9;
|
|
464
|
+
let s2 = 1, r2 = false, o2 = false, a2 = "";
|
|
465
|
+
for (;e2 < t2.length; e2++)
|
|
466
|
+
if (t2[e2] !== "<" || o2)
|
|
467
|
+
if (t2[e2] === ">") {
|
|
468
|
+
if (o2 ? t2[e2 - 1] === "-" && t2[e2 - 2] === "-" && (o2 = false, s2--) : s2--, s2 === 0)
|
|
469
|
+
break;
|
|
470
|
+
} else
|
|
471
|
+
t2[e2] === "[" ? r2 = true : a2 += t2[e2];
|
|
472
|
+
else {
|
|
473
|
+
if (r2 && M(t2, "!ENTITY", e2)) {
|
|
474
|
+
let s3, r3;
|
|
475
|
+
if (e2 += 7, [s3, r3, e2] = this.readEntityExp(t2, e2 + 1, this.suppressValidationErr), r3.indexOf("&") === -1) {
|
|
476
|
+
if (this.options.enabled !== false && this.options.maxEntityCount != null && n2 >= this.options.maxEntityCount)
|
|
477
|
+
throw new Error(`Entity count (${n2 + 1}) exceeds maximum allowed (${this.options.maxEntityCount})`);
|
|
478
|
+
const t3 = s3.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
479
|
+
i2[s3] = { regx: RegExp(`&${t3};`, "g"), val: r3 }, n2++;
|
|
480
|
+
}
|
|
481
|
+
} else if (r2 && M(t2, "!ELEMENT", e2)) {
|
|
482
|
+
e2 += 8;
|
|
483
|
+
const { index: i3 } = this.readElementExp(t2, e2 + 1);
|
|
484
|
+
e2 = i3;
|
|
485
|
+
} else if (r2 && M(t2, "!ATTLIST", e2))
|
|
486
|
+
e2 += 8;
|
|
487
|
+
else if (r2 && M(t2, "!NOTATION", e2)) {
|
|
488
|
+
e2 += 9;
|
|
489
|
+
const { index: i3 } = this.readNotationExp(t2, e2 + 1, this.suppressValidationErr);
|
|
490
|
+
e2 = i3;
|
|
491
|
+
} else {
|
|
492
|
+
if (!M(t2, "!--", e2))
|
|
493
|
+
throw new Error("Invalid DOCTYPE");
|
|
494
|
+
o2 = true;
|
|
495
|
+
}
|
|
496
|
+
s2++, a2 = "";
|
|
497
|
+
}
|
|
498
|
+
if (s2 !== 0)
|
|
499
|
+
throw new Error("Unclosed DOCTYPE");
|
|
500
|
+
}
|
|
501
|
+
return { entities: i2, i: e2 };
|
|
502
|
+
}
|
|
503
|
+
readEntityExp(t2, e2) {
|
|
504
|
+
const i2 = e2 = j(t2, e2);
|
|
505
|
+
for (;e2 < t2.length && !/\s/.test(t2[e2]) && t2[e2] !== '"' && t2[e2] !== "'"; )
|
|
506
|
+
e2++;
|
|
507
|
+
let n2 = t2.substring(i2, e2);
|
|
508
|
+
if (_(n2), e2 = j(t2, e2), !this.suppressValidationErr) {
|
|
509
|
+
if (t2.substring(e2, e2 + 6).toUpperCase() === "SYSTEM")
|
|
510
|
+
throw new Error("External entities are not supported");
|
|
511
|
+
if (t2[e2] === "%")
|
|
512
|
+
throw new Error("Parameter entities are not supported");
|
|
513
|
+
}
|
|
514
|
+
let s2 = "";
|
|
515
|
+
if ([e2, s2] = this.readIdentifierVal(t2, e2, "entity"), this.options.enabled !== false && this.options.maxEntitySize != null && s2.length > this.options.maxEntitySize)
|
|
516
|
+
throw new Error(`Entity "${n2}" size (${s2.length}) exceeds maximum allowed size (${this.options.maxEntitySize})`);
|
|
517
|
+
return [n2, s2, --e2];
|
|
518
|
+
}
|
|
519
|
+
readNotationExp(t2, e2) {
|
|
520
|
+
const i2 = e2 = j(t2, e2);
|
|
521
|
+
for (;e2 < t2.length && !/\s/.test(t2[e2]); )
|
|
522
|
+
e2++;
|
|
523
|
+
let n2 = t2.substring(i2, e2);
|
|
524
|
+
!this.suppressValidationErr && _(n2), e2 = j(t2, e2);
|
|
525
|
+
const s2 = t2.substring(e2, e2 + 6).toUpperCase();
|
|
526
|
+
if (!this.suppressValidationErr && s2 !== "SYSTEM" && s2 !== "PUBLIC")
|
|
527
|
+
throw new Error(`Expected SYSTEM or PUBLIC, found "${s2}"`);
|
|
528
|
+
e2 += s2.length, e2 = j(t2, e2);
|
|
529
|
+
let r2 = null, o2 = null;
|
|
530
|
+
if (s2 === "PUBLIC")
|
|
531
|
+
[e2, r2] = this.readIdentifierVal(t2, e2, "publicIdentifier"), t2[e2 = j(t2, e2)] !== '"' && t2[e2] !== "'" || ([e2, o2] = this.readIdentifierVal(t2, e2, "systemIdentifier"));
|
|
532
|
+
else if (s2 === "SYSTEM" && ([e2, o2] = this.readIdentifierVal(t2, e2, "systemIdentifier"), !this.suppressValidationErr && !o2))
|
|
533
|
+
throw new Error("Missing mandatory system identifier for SYSTEM notation");
|
|
534
|
+
return { notationName: n2, publicIdentifier: r2, systemIdentifier: o2, index: --e2 };
|
|
535
|
+
}
|
|
536
|
+
readIdentifierVal(t2, e2, i2) {
|
|
537
|
+
let n2 = "";
|
|
538
|
+
const s2 = t2[e2];
|
|
539
|
+
if (s2 !== '"' && s2 !== "'")
|
|
540
|
+
throw new Error(`Expected quoted string, found "${s2}"`);
|
|
541
|
+
const r2 = ++e2;
|
|
542
|
+
for (;e2 < t2.length && t2[e2] !== s2; )
|
|
543
|
+
e2++;
|
|
544
|
+
if (n2 = t2.substring(r2, e2), t2[e2] !== s2)
|
|
545
|
+
throw new Error(`Unterminated ${i2} value`);
|
|
546
|
+
return [++e2, n2];
|
|
547
|
+
}
|
|
548
|
+
readElementExp(t2, e2) {
|
|
549
|
+
const i2 = e2 = j(t2, e2);
|
|
550
|
+
for (;e2 < t2.length && !/\s/.test(t2[e2]); )
|
|
551
|
+
e2++;
|
|
552
|
+
let n2 = t2.substring(i2, e2);
|
|
553
|
+
if (!this.suppressValidationErr && !r(n2))
|
|
554
|
+
throw new Error(`Invalid element name: "${n2}"`);
|
|
555
|
+
let s2 = "";
|
|
556
|
+
if (t2[e2 = j(t2, e2)] === "E" && M(t2, "MPTY", e2))
|
|
557
|
+
e2 += 4;
|
|
558
|
+
else if (t2[e2] === "A" && M(t2, "NY", e2))
|
|
559
|
+
e2 += 2;
|
|
560
|
+
else if (t2[e2] === "(") {
|
|
561
|
+
const i3 = ++e2;
|
|
562
|
+
for (;e2 < t2.length && t2[e2] !== ")"; )
|
|
563
|
+
e2++;
|
|
564
|
+
if (s2 = t2.substring(i3, e2), t2[e2] !== ")")
|
|
565
|
+
throw new Error("Unterminated content model");
|
|
566
|
+
} else if (!this.suppressValidationErr)
|
|
567
|
+
throw new Error(`Invalid Element Expression, found "${t2[e2]}"`);
|
|
568
|
+
return { elementName: n2, contentModel: s2.trim(), index: e2 };
|
|
569
|
+
}
|
|
570
|
+
readAttlistExp(t2, e2) {
|
|
571
|
+
let i2 = e2 = j(t2, e2);
|
|
572
|
+
for (;e2 < t2.length && !/\s/.test(t2[e2]); )
|
|
573
|
+
e2++;
|
|
574
|
+
let n2 = t2.substring(i2, e2);
|
|
575
|
+
for (_(n2), i2 = e2 = j(t2, e2);e2 < t2.length && !/\s/.test(t2[e2]); )
|
|
576
|
+
e2++;
|
|
577
|
+
let s2 = t2.substring(i2, e2);
|
|
578
|
+
if (!_(s2))
|
|
579
|
+
throw new Error(`Invalid attribute name: "${s2}"`);
|
|
580
|
+
e2 = j(t2, e2);
|
|
581
|
+
let r2 = "";
|
|
582
|
+
if (t2.substring(e2, e2 + 8).toUpperCase() === "NOTATION") {
|
|
583
|
+
if (r2 = "NOTATION", t2[e2 = j(t2, e2 += 8)] !== "(")
|
|
584
|
+
throw new Error(`Expected '(', found "${t2[e2]}"`);
|
|
585
|
+
e2++;
|
|
586
|
+
let i3 = [];
|
|
587
|
+
for (;e2 < t2.length && t2[e2] !== ")"; ) {
|
|
588
|
+
const n3 = e2;
|
|
589
|
+
for (;e2 < t2.length && t2[e2] !== "|" && t2[e2] !== ")"; )
|
|
590
|
+
e2++;
|
|
591
|
+
let s3 = t2.substring(n3, e2);
|
|
592
|
+
if (s3 = s3.trim(), !_(s3))
|
|
593
|
+
throw new Error(`Invalid notation name: "${s3}"`);
|
|
594
|
+
i3.push(s3), t2[e2] === "|" && (e2++, e2 = j(t2, e2));
|
|
595
|
+
}
|
|
596
|
+
if (t2[e2] !== ")")
|
|
597
|
+
throw new Error("Unterminated list of notations");
|
|
598
|
+
e2++, r2 += " (" + i3.join("|") + ")";
|
|
599
|
+
} else {
|
|
600
|
+
const i3 = e2;
|
|
601
|
+
for (;e2 < t2.length && !/\s/.test(t2[e2]); )
|
|
602
|
+
e2++;
|
|
603
|
+
r2 += t2.substring(i3, e2);
|
|
604
|
+
const n3 = ["CDATA", "ID", "IDREF", "IDREFS", "ENTITY", "ENTITIES", "NMTOKEN", "NMTOKENS"];
|
|
605
|
+
if (!this.suppressValidationErr && !n3.includes(r2.toUpperCase()))
|
|
606
|
+
throw new Error(`Invalid attribute type: "${r2}"`);
|
|
607
|
+
}
|
|
608
|
+
e2 = j(t2, e2);
|
|
609
|
+
let o2 = "";
|
|
610
|
+
return t2.substring(e2, e2 + 8).toUpperCase() === "#REQUIRED" ? (o2 = "#REQUIRED", e2 += 8) : t2.substring(e2, e2 + 7).toUpperCase() === "#IMPLIED" ? (o2 = "#IMPLIED", e2 += 7) : [e2, o2] = this.readIdentifierVal(t2, e2, "ATTLIST"), { elementName: n2, attributeName: s2, attributeType: r2, defaultValue: o2, index: e2 };
|
|
611
|
+
}
|
|
612
|
+
}
|
|
613
|
+
const j = (t2, e2) => {
|
|
614
|
+
for (;e2 < t2.length && /\s/.test(t2[e2]); )
|
|
615
|
+
e2++;
|
|
616
|
+
return e2;
|
|
617
|
+
};
|
|
618
|
+
function M(t2, e2, i2) {
|
|
619
|
+
for (let n2 = 0;n2 < e2.length; n2++)
|
|
620
|
+
if (e2[n2] !== t2[i2 + n2 + 1])
|
|
621
|
+
return false;
|
|
622
|
+
return true;
|
|
623
|
+
}
|
|
624
|
+
function _(t2) {
|
|
625
|
+
if (r(t2))
|
|
626
|
+
return t2;
|
|
627
|
+
throw new Error(`Invalid entity name ${t2}`);
|
|
628
|
+
}
|
|
629
|
+
const D = /^[-+]?0x[a-fA-F0-9]+$/, V = /^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/, k = { hex: true, leadingZeros: true, decimalPoint: ".", eNotation: true, infinity: "original" };
|
|
630
|
+
const F = /^([-+])?(0*)(\d*(\.\d*)?[eE][-\+]?\d+)$/, L = new Set(["push", "pop", "reset", "updateCurrent", "restore"]);
|
|
631
|
+
|
|
632
|
+
class G {
|
|
633
|
+
constructor(t2 = {}) {
|
|
634
|
+
this.separator = t2.separator || ".", this.path = [], this.siblingStacks = [];
|
|
635
|
+
}
|
|
636
|
+
push(t2, e2 = null, i2 = null) {
|
|
637
|
+
this.path.length > 0 && (this.path[this.path.length - 1].values = undefined);
|
|
638
|
+
const n2 = this.path.length;
|
|
639
|
+
this.siblingStacks[n2] || (this.siblingStacks[n2] = new Map);
|
|
640
|
+
const s2 = this.siblingStacks[n2], r2 = i2 ? `${i2}:${t2}` : t2, o2 = s2.get(r2) || 0;
|
|
641
|
+
let a2 = 0;
|
|
642
|
+
for (const t3 of s2.values())
|
|
643
|
+
a2 += t3;
|
|
644
|
+
s2.set(r2, o2 + 1);
|
|
645
|
+
const h2 = { tag: t2, position: a2, counter: o2 };
|
|
646
|
+
i2 != null && (h2.namespace = i2), e2 != null && (h2.values = e2), this.path.push(h2);
|
|
647
|
+
}
|
|
648
|
+
pop() {
|
|
649
|
+
if (this.path.length === 0)
|
|
650
|
+
return;
|
|
651
|
+
const t2 = this.path.pop();
|
|
652
|
+
return this.siblingStacks.length > this.path.length + 1 && (this.siblingStacks.length = this.path.length + 1), t2;
|
|
653
|
+
}
|
|
654
|
+
updateCurrent(t2) {
|
|
655
|
+
if (this.path.length > 0) {
|
|
656
|
+
const e2 = this.path[this.path.length - 1];
|
|
657
|
+
t2 != null && (e2.values = t2);
|
|
658
|
+
}
|
|
659
|
+
}
|
|
660
|
+
getCurrentTag() {
|
|
661
|
+
return this.path.length > 0 ? this.path[this.path.length - 1].tag : undefined;
|
|
662
|
+
}
|
|
663
|
+
getCurrentNamespace() {
|
|
664
|
+
return this.path.length > 0 ? this.path[this.path.length - 1].namespace : undefined;
|
|
665
|
+
}
|
|
666
|
+
getAttrValue(t2) {
|
|
667
|
+
if (this.path.length === 0)
|
|
668
|
+
return;
|
|
669
|
+
const e2 = this.path[this.path.length - 1];
|
|
670
|
+
return e2.values?.[t2];
|
|
671
|
+
}
|
|
672
|
+
hasAttr(t2) {
|
|
673
|
+
if (this.path.length === 0)
|
|
674
|
+
return false;
|
|
675
|
+
const e2 = this.path[this.path.length - 1];
|
|
676
|
+
return e2.values !== undefined && t2 in e2.values;
|
|
677
|
+
}
|
|
678
|
+
getPosition() {
|
|
679
|
+
return this.path.length === 0 ? -1 : this.path[this.path.length - 1].position ?? 0;
|
|
680
|
+
}
|
|
681
|
+
getCounter() {
|
|
682
|
+
return this.path.length === 0 ? -1 : this.path[this.path.length - 1].counter ?? 0;
|
|
683
|
+
}
|
|
684
|
+
getIndex() {
|
|
685
|
+
return this.getPosition();
|
|
686
|
+
}
|
|
687
|
+
getDepth() {
|
|
688
|
+
return this.path.length;
|
|
689
|
+
}
|
|
690
|
+
toString(t2, e2 = true) {
|
|
691
|
+
const i2 = t2 || this.separator;
|
|
692
|
+
return this.path.map((t3) => e2 && t3.namespace ? `${t3.namespace}:${t3.tag}` : t3.tag).join(i2);
|
|
693
|
+
}
|
|
694
|
+
toArray() {
|
|
695
|
+
return this.path.map((t2) => t2.tag);
|
|
696
|
+
}
|
|
697
|
+
reset() {
|
|
698
|
+
this.path = [], this.siblingStacks = [];
|
|
699
|
+
}
|
|
700
|
+
matches(t2) {
|
|
701
|
+
const e2 = t2.segments;
|
|
702
|
+
return e2.length !== 0 && (t2.hasDeepWildcard() ? this._matchWithDeepWildcard(e2) : this._matchSimple(e2));
|
|
703
|
+
}
|
|
704
|
+
_matchSimple(t2) {
|
|
705
|
+
if (this.path.length !== t2.length)
|
|
706
|
+
return false;
|
|
707
|
+
for (let e2 = 0;e2 < t2.length; e2++) {
|
|
708
|
+
const i2 = t2[e2], n2 = this.path[e2], s2 = e2 === this.path.length - 1;
|
|
709
|
+
if (!this._matchSegment(i2, n2, s2))
|
|
710
|
+
return false;
|
|
711
|
+
}
|
|
712
|
+
return true;
|
|
713
|
+
}
|
|
714
|
+
_matchWithDeepWildcard(t2) {
|
|
715
|
+
let e2 = this.path.length - 1, i2 = t2.length - 1;
|
|
716
|
+
for (;i2 >= 0 && e2 >= 0; ) {
|
|
717
|
+
const n2 = t2[i2];
|
|
718
|
+
if (n2.type === "deep-wildcard") {
|
|
719
|
+
if (i2--, i2 < 0)
|
|
720
|
+
return true;
|
|
721
|
+
const n3 = t2[i2];
|
|
722
|
+
let s2 = false;
|
|
723
|
+
for (let t3 = e2;t3 >= 0; t3--) {
|
|
724
|
+
const r2 = t3 === this.path.length - 1;
|
|
725
|
+
if (this._matchSegment(n3, this.path[t3], r2)) {
|
|
726
|
+
e2 = t3 - 1, i2--, s2 = true;
|
|
727
|
+
break;
|
|
728
|
+
}
|
|
729
|
+
}
|
|
730
|
+
if (!s2)
|
|
731
|
+
return false;
|
|
732
|
+
} else {
|
|
733
|
+
const t3 = e2 === this.path.length - 1;
|
|
734
|
+
if (!this._matchSegment(n2, this.path[e2], t3))
|
|
735
|
+
return false;
|
|
736
|
+
e2--, i2--;
|
|
737
|
+
}
|
|
738
|
+
}
|
|
739
|
+
return i2 < 0;
|
|
740
|
+
}
|
|
741
|
+
_matchSegment(t2, e2, i2) {
|
|
742
|
+
if (t2.tag !== "*" && t2.tag !== e2.tag)
|
|
743
|
+
return false;
|
|
744
|
+
if (t2.namespace !== undefined && t2.namespace !== "*" && t2.namespace !== e2.namespace)
|
|
745
|
+
return false;
|
|
746
|
+
if (t2.attrName !== undefined) {
|
|
747
|
+
if (!i2)
|
|
748
|
+
return false;
|
|
749
|
+
if (!e2.values || !(t2.attrName in e2.values))
|
|
750
|
+
return false;
|
|
751
|
+
if (t2.attrValue !== undefined) {
|
|
752
|
+
const i3 = e2.values[t2.attrName];
|
|
753
|
+
if (String(i3) !== String(t2.attrValue))
|
|
754
|
+
return false;
|
|
755
|
+
}
|
|
756
|
+
}
|
|
757
|
+
if (t2.position !== undefined) {
|
|
758
|
+
if (!i2)
|
|
759
|
+
return false;
|
|
760
|
+
const n2 = e2.counter ?? 0;
|
|
761
|
+
if (t2.position === "first" && n2 !== 0)
|
|
762
|
+
return false;
|
|
763
|
+
if (t2.position === "odd" && n2 % 2 != 1)
|
|
764
|
+
return false;
|
|
765
|
+
if (t2.position === "even" && n2 % 2 != 0)
|
|
766
|
+
return false;
|
|
767
|
+
if (t2.position === "nth" && n2 !== t2.positionValue)
|
|
768
|
+
return false;
|
|
769
|
+
}
|
|
770
|
+
return true;
|
|
771
|
+
}
|
|
772
|
+
snapshot() {
|
|
773
|
+
return { path: this.path.map((t2) => ({ ...t2 })), siblingStacks: this.siblingStacks.map((t2) => new Map(t2)) };
|
|
774
|
+
}
|
|
775
|
+
restore(t2) {
|
|
776
|
+
this.path = t2.path.map((t3) => ({ ...t3 })), this.siblingStacks = t2.siblingStacks.map((t3) => new Map(t3));
|
|
777
|
+
}
|
|
778
|
+
readOnly() {
|
|
779
|
+
return new Proxy(this, { get(t2, e2, i2) {
|
|
780
|
+
if (L.has(e2))
|
|
781
|
+
return () => {
|
|
782
|
+
throw new TypeError(`Cannot call '${e2}' on a read-only Matcher. Obtain a writable instance to mutate state.`);
|
|
783
|
+
};
|
|
784
|
+
const n2 = Reflect.get(t2, e2, i2);
|
|
785
|
+
return e2 === "path" || e2 === "siblingStacks" ? Object.freeze(Array.isArray(n2) ? n2.map((t3) => t3 instanceof Map ? Object.freeze(new Map(t3)) : Object.freeze({ ...t3 })) : n2) : typeof n2 == "function" ? n2.bind(t2) : n2;
|
|
786
|
+
}, set(t2, e2) {
|
|
787
|
+
throw new TypeError(`Cannot set property '${String(e2)}' on a read-only Matcher.`);
|
|
788
|
+
}, deleteProperty(t2, e2) {
|
|
789
|
+
throw new TypeError(`Cannot delete property '${String(e2)}' from a read-only Matcher.`);
|
|
790
|
+
} });
|
|
791
|
+
}
|
|
792
|
+
}
|
|
793
|
+
|
|
794
|
+
class R {
|
|
795
|
+
constructor(t2, e2 = {}) {
|
|
796
|
+
this.pattern = t2, this.separator = e2.separator || ".", this.segments = this._parse(t2), this._hasDeepWildcard = this.segments.some((t3) => t3.type === "deep-wildcard"), this._hasAttributeCondition = this.segments.some((t3) => t3.attrName !== undefined), this._hasPositionSelector = this.segments.some((t3) => t3.position !== undefined);
|
|
797
|
+
}
|
|
798
|
+
_parse(t2) {
|
|
799
|
+
const e2 = [];
|
|
800
|
+
let i2 = 0, n2 = "";
|
|
801
|
+
for (;i2 < t2.length; )
|
|
802
|
+
t2[i2] === this.separator ? i2 + 1 < t2.length && t2[i2 + 1] === this.separator ? (n2.trim() && (e2.push(this._parseSegment(n2.trim())), n2 = ""), e2.push({ type: "deep-wildcard" }), i2 += 2) : (n2.trim() && e2.push(this._parseSegment(n2.trim())), n2 = "", i2++) : (n2 += t2[i2], i2++);
|
|
803
|
+
return n2.trim() && e2.push(this._parseSegment(n2.trim())), e2;
|
|
804
|
+
}
|
|
805
|
+
_parseSegment(t2) {
|
|
806
|
+
const e2 = { type: "tag" };
|
|
807
|
+
let i2 = null, n2 = t2;
|
|
808
|
+
const s2 = t2.match(/^([^\[]+)(\[[^\]]*\])(.*)$/);
|
|
809
|
+
if (s2 && (n2 = s2[1] + s2[3], s2[2])) {
|
|
810
|
+
const t3 = s2[2].slice(1, -1);
|
|
811
|
+
t3 && (i2 = t3);
|
|
812
|
+
}
|
|
813
|
+
let r2, o2, a2 = n2;
|
|
814
|
+
if (n2.includes("::")) {
|
|
815
|
+
const e3 = n2.indexOf("::");
|
|
816
|
+
if (r2 = n2.substring(0, e3).trim(), a2 = n2.substring(e3 + 2).trim(), !r2)
|
|
817
|
+
throw new Error(`Invalid namespace in pattern: ${t2}`);
|
|
818
|
+
}
|
|
819
|
+
let h2 = null;
|
|
820
|
+
if (a2.includes(":")) {
|
|
821
|
+
const t3 = a2.lastIndexOf(":"), e3 = a2.substring(0, t3).trim(), i3 = a2.substring(t3 + 1).trim();
|
|
822
|
+
["first", "last", "odd", "even"].includes(i3) || /^nth\(\d+\)$/.test(i3) ? (o2 = e3, h2 = i3) : o2 = a2;
|
|
823
|
+
} else
|
|
824
|
+
o2 = a2;
|
|
825
|
+
if (!o2)
|
|
826
|
+
throw new Error(`Invalid segment pattern: ${t2}`);
|
|
827
|
+
if (e2.tag = o2, r2 && (e2.namespace = r2), i2)
|
|
828
|
+
if (i2.includes("=")) {
|
|
829
|
+
const t3 = i2.indexOf("=");
|
|
830
|
+
e2.attrName = i2.substring(0, t3).trim(), e2.attrValue = i2.substring(t3 + 1).trim();
|
|
831
|
+
} else
|
|
832
|
+
e2.attrName = i2.trim();
|
|
833
|
+
if (h2) {
|
|
834
|
+
const t3 = h2.match(/^nth\((\d+)\)$/);
|
|
835
|
+
t3 ? (e2.position = "nth", e2.positionValue = parseInt(t3[1], 10)) : e2.position = h2;
|
|
836
|
+
}
|
|
837
|
+
return e2;
|
|
838
|
+
}
|
|
839
|
+
get length() {
|
|
840
|
+
return this.segments.length;
|
|
841
|
+
}
|
|
842
|
+
hasDeepWildcard() {
|
|
843
|
+
return this._hasDeepWildcard;
|
|
844
|
+
}
|
|
845
|
+
hasAttributeCondition() {
|
|
846
|
+
return this._hasAttributeCondition;
|
|
847
|
+
}
|
|
848
|
+
hasPositionSelector() {
|
|
849
|
+
return this._hasPositionSelector;
|
|
850
|
+
}
|
|
851
|
+
toString() {
|
|
852
|
+
return this.pattern;
|
|
853
|
+
}
|
|
854
|
+
}
|
|
855
|
+
function U(t2, e2) {
|
|
856
|
+
if (!t2)
|
|
857
|
+
return {};
|
|
858
|
+
const i2 = e2.attributesGroupName ? t2[e2.attributesGroupName] : t2;
|
|
859
|
+
if (!i2)
|
|
860
|
+
return {};
|
|
861
|
+
const n2 = {};
|
|
862
|
+
for (const t3 in i2)
|
|
863
|
+
t3.startsWith(e2.attributeNamePrefix) ? n2[t3.substring(e2.attributeNamePrefix.length)] = i2[t3] : n2[t3] = i2[t3];
|
|
864
|
+
return n2;
|
|
865
|
+
}
|
|
866
|
+
function B(t2) {
|
|
867
|
+
if (!t2 || typeof t2 != "string")
|
|
868
|
+
return;
|
|
869
|
+
const e2 = t2.indexOf(":");
|
|
870
|
+
if (e2 !== -1 && e2 > 0) {
|
|
871
|
+
const i2 = t2.substring(0, e2);
|
|
872
|
+
if (i2 !== "xmlns")
|
|
873
|
+
return i2;
|
|
874
|
+
}
|
|
875
|
+
}
|
|
876
|
+
|
|
877
|
+
class W {
|
|
878
|
+
constructor(t2) {
|
|
879
|
+
var e2;
|
|
880
|
+
if (this.options = t2, this.currentNode = null, this.tagsNodeStack = [], this.docTypeEntities = {}, this.lastEntities = { apos: { regex: /&(apos|#39|#x27);/g, val: "'" }, gt: { regex: /&(gt|#62|#x3E);/g, val: ">" }, lt: { regex: /&(lt|#60|#x3C);/g, val: "<" }, quot: { regex: /&(quot|#34|#x22);/g, val: '"' } }, this.ampEntity = { regex: /&(amp|#38|#x26);/g, val: "&" }, this.htmlEntities = { space: { regex: /&(nbsp|#160);/g, val: " " }, cent: { regex: /&(cent|#162);/g, val: "\xA2" }, pound: { regex: /&(pound|#163);/g, val: "\xA3" }, yen: { regex: /&(yen|#165);/g, val: "\xA5" }, euro: { regex: /&(euro|#8364);/g, val: "\u20AC" }, copyright: { regex: /&(copy|#169);/g, val: "\xA9" }, reg: { regex: /&(reg|#174);/g, val: "\xAE" }, inr: { regex: /&(inr|#8377);/g, val: "\u20B9" }, num_dec: { regex: /&#([0-9]{1,7});/g, val: (t3, e3) => rt(e3, 10, "&#") }, num_hex: { regex: /&#x([0-9a-fA-F]{1,6});/g, val: (t3, e3) => rt(e3, 16, "&#x") } }, this.addExternalEntities = Y, this.parseXml = J, this.parseTextData = z, this.resolveNameSpace = X, this.buildAttributesMap = Z, this.isItStopNode = tt, this.replaceEntitiesValue = Q, this.readStopNodeData = nt, this.saveTextToParentTag = H, this.addChild = K, this.ignoreAttributesFn = typeof (e2 = this.options.ignoreAttributes) == "function" ? e2 : Array.isArray(e2) ? (t3) => {
|
|
881
|
+
for (const i2 of e2) {
|
|
882
|
+
if (typeof i2 == "string" && t3 === i2)
|
|
883
|
+
return true;
|
|
884
|
+
if (i2 instanceof RegExp && i2.test(t3))
|
|
885
|
+
return true;
|
|
886
|
+
}
|
|
887
|
+
} : () => false, this.entityExpansionCount = 0, this.currentExpandedLength = 0, this.matcher = new G, this.readonlyMatcher = this.matcher.readOnly(), this.isCurrentNodeStopNode = false, this.options.stopNodes && this.options.stopNodes.length > 0) {
|
|
888
|
+
this.stopNodeExpressions = [];
|
|
889
|
+
for (let t3 = 0;t3 < this.options.stopNodes.length; t3++) {
|
|
890
|
+
const e3 = this.options.stopNodes[t3];
|
|
891
|
+
typeof e3 == "string" ? this.stopNodeExpressions.push(new R(e3)) : e3 instanceof R && this.stopNodeExpressions.push(e3);
|
|
892
|
+
}
|
|
893
|
+
}
|
|
894
|
+
}
|
|
895
|
+
}
|
|
896
|
+
function Y(t2) {
|
|
897
|
+
const e2 = Object.keys(t2);
|
|
898
|
+
for (let i2 = 0;i2 < e2.length; i2++) {
|
|
899
|
+
const n2 = e2[i2], s2 = n2.replace(/[.\-+*:]/g, "\\.");
|
|
900
|
+
this.lastEntities[n2] = { regex: new RegExp("&" + s2 + ";", "g"), val: t2[n2] };
|
|
901
|
+
}
|
|
902
|
+
}
|
|
903
|
+
function z(t2, e2, i2, n2, s2, r2, o2) {
|
|
904
|
+
if (t2 !== undefined && (this.options.trimValues && !n2 && (t2 = t2.trim()), t2.length > 0)) {
|
|
905
|
+
o2 || (t2 = this.replaceEntitiesValue(t2, e2, i2));
|
|
906
|
+
const n3 = this.options.jPath ? i2.toString() : i2, a2 = this.options.tagValueProcessor(e2, t2, n3, s2, r2);
|
|
907
|
+
return a2 == null ? t2 : typeof a2 != typeof t2 || a2 !== t2 ? a2 : this.options.trimValues || t2.trim() === t2 ? st(t2, this.options.parseTagValue, this.options.numberParseOptions) : t2;
|
|
908
|
+
}
|
|
909
|
+
}
|
|
910
|
+
function X(t2) {
|
|
911
|
+
if (this.options.removeNSPrefix) {
|
|
912
|
+
const e2 = t2.split(":"), i2 = t2.charAt(0) === "/" ? "/" : "";
|
|
913
|
+
if (e2[0] === "xmlns")
|
|
914
|
+
return "";
|
|
915
|
+
e2.length === 2 && (t2 = i2 + e2[1]);
|
|
916
|
+
}
|
|
917
|
+
return t2;
|
|
918
|
+
}
|
|
919
|
+
const q = new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`, "gm");
|
|
920
|
+
function Z(t2, e2, i2) {
|
|
921
|
+
if (this.options.ignoreAttributes !== true && typeof t2 == "string") {
|
|
922
|
+
const n2 = s(t2, q), r2 = n2.length, o2 = {}, a2 = {};
|
|
923
|
+
for (let t3 = 0;t3 < r2; t3++) {
|
|
924
|
+
const e3 = this.resolveNameSpace(n2[t3][1]), s2 = n2[t3][4];
|
|
925
|
+
if (e3.length && s2 !== undefined) {
|
|
926
|
+
let t4 = s2;
|
|
927
|
+
this.options.trimValues && (t4 = t4.trim()), t4 = this.replaceEntitiesValue(t4, i2, this.readonlyMatcher), a2[e3] = t4;
|
|
928
|
+
}
|
|
929
|
+
}
|
|
930
|
+
Object.keys(a2).length > 0 && typeof e2 == "object" && e2.updateCurrent && e2.updateCurrent(a2);
|
|
931
|
+
for (let t3 = 0;t3 < r2; t3++) {
|
|
932
|
+
const s2 = this.resolveNameSpace(n2[t3][1]), r3 = this.options.jPath ? e2.toString() : this.readonlyMatcher;
|
|
933
|
+
if (this.ignoreAttributesFn(s2, r3))
|
|
934
|
+
continue;
|
|
935
|
+
let a3 = n2[t3][4], h2 = this.options.attributeNamePrefix + s2;
|
|
936
|
+
if (s2.length)
|
|
937
|
+
if (this.options.transformAttributeName && (h2 = this.options.transformAttributeName(h2)), h2 = at(h2, this.options), a3 !== undefined) {
|
|
938
|
+
this.options.trimValues && (a3 = a3.trim()), a3 = this.replaceEntitiesValue(a3, i2, this.readonlyMatcher);
|
|
939
|
+
const t4 = this.options.jPath ? e2.toString() : this.readonlyMatcher, n3 = this.options.attributeValueProcessor(s2, a3, t4);
|
|
940
|
+
o2[h2] = n3 == null ? a3 : typeof n3 != typeof a3 || n3 !== a3 ? n3 : st(a3, this.options.parseAttributeValue, this.options.numberParseOptions);
|
|
941
|
+
} else
|
|
942
|
+
this.options.allowBooleanAttributes && (o2[h2] = true);
|
|
943
|
+
}
|
|
944
|
+
if (!Object.keys(o2).length)
|
|
945
|
+
return;
|
|
946
|
+
if (this.options.attributesGroupName) {
|
|
947
|
+
const t3 = {};
|
|
948
|
+
return t3[this.options.attributesGroupName] = o2, t3;
|
|
949
|
+
}
|
|
950
|
+
return o2;
|
|
951
|
+
}
|
|
952
|
+
}
|
|
953
|
+
const J = function(t2) {
|
|
954
|
+
t2 = t2.replace(/\r\n?/g, `
|
|
955
|
+
`);
|
|
956
|
+
const e2 = new $("!xml");
|
|
957
|
+
let i2 = e2, n2 = "";
|
|
958
|
+
this.matcher.reset(), this.entityExpansionCount = 0, this.currentExpandedLength = 0;
|
|
959
|
+
const s2 = new I(this.options.processEntities);
|
|
960
|
+
for (let r2 = 0;r2 < t2.length; r2++)
|
|
961
|
+
if (t2[r2] === "<")
|
|
962
|
+
if (t2[r2 + 1] === "/") {
|
|
963
|
+
const e3 = et(t2, ">", r2, "Closing Tag is not closed.");
|
|
964
|
+
let s3 = t2.substring(r2 + 2, e3).trim();
|
|
965
|
+
if (this.options.removeNSPrefix) {
|
|
966
|
+
const t3 = s3.indexOf(":");
|
|
967
|
+
t3 !== -1 && (s3 = s3.substr(t3 + 1));
|
|
968
|
+
}
|
|
969
|
+
s3 = ot(this.options.transformTagName, s3, "", this.options).tagName, i2 && (n2 = this.saveTextToParentTag(n2, i2, this.readonlyMatcher));
|
|
970
|
+
const o2 = this.matcher.getCurrentTag();
|
|
971
|
+
if (s3 && this.options.unpairedTags.indexOf(s3) !== -1)
|
|
972
|
+
throw new Error(`Unpaired tag can not be used as closing tag: </${s3}>`);
|
|
973
|
+
o2 && this.options.unpairedTags.indexOf(o2) !== -1 && (this.matcher.pop(), this.tagsNodeStack.pop()), this.matcher.pop(), this.isCurrentNodeStopNode = false, i2 = this.tagsNodeStack.pop(), n2 = "", r2 = e3;
|
|
974
|
+
} else if (t2[r2 + 1] === "?") {
|
|
975
|
+
let e3 = it(t2, r2, false, "?>");
|
|
976
|
+
if (!e3)
|
|
977
|
+
throw new Error("Pi Tag is not closed.");
|
|
978
|
+
if (n2 = this.saveTextToParentTag(n2, i2, this.readonlyMatcher), this.options.ignoreDeclaration && e3.tagName === "?xml" || this.options.ignorePiTags)
|
|
979
|
+
;
|
|
980
|
+
else {
|
|
981
|
+
const t3 = new $(e3.tagName);
|
|
982
|
+
t3.add(this.options.textNodeName, ""), e3.tagName !== e3.tagExp && e3.attrExpPresent && (t3[":@"] = this.buildAttributesMap(e3.tagExp, this.matcher, e3.tagName)), this.addChild(i2, t3, this.readonlyMatcher, r2);
|
|
983
|
+
}
|
|
984
|
+
r2 = e3.closeIndex + 1;
|
|
985
|
+
} else if (t2.substr(r2 + 1, 3) === "!--") {
|
|
986
|
+
const e3 = et(t2, "-->", r2 + 4, "Comment is not closed.");
|
|
987
|
+
if (this.options.commentPropName) {
|
|
988
|
+
const s3 = t2.substring(r2 + 4, e3 - 2);
|
|
989
|
+
n2 = this.saveTextToParentTag(n2, i2, this.readonlyMatcher), i2.add(this.options.commentPropName, [{ [this.options.textNodeName]: s3 }]);
|
|
990
|
+
}
|
|
991
|
+
r2 = e3;
|
|
992
|
+
} else if (t2.substr(r2 + 1, 2) === "!D") {
|
|
993
|
+
const e3 = s2.readDocType(t2, r2);
|
|
994
|
+
this.docTypeEntities = e3.entities, r2 = e3.i;
|
|
995
|
+
} else if (t2.substr(r2 + 1, 2) === "![") {
|
|
996
|
+
const e3 = et(t2, "]]>", r2, "CDATA is not closed.") - 2, s3 = t2.substring(r2 + 9, e3);
|
|
997
|
+
n2 = this.saveTextToParentTag(n2, i2, this.readonlyMatcher);
|
|
998
|
+
let o2 = this.parseTextData(s3, i2.tagname, this.readonlyMatcher, true, false, true, true);
|
|
999
|
+
o2 == null && (o2 = ""), this.options.cdataPropName ? i2.add(this.options.cdataPropName, [{ [this.options.textNodeName]: s3 }]) : i2.add(this.options.textNodeName, o2), r2 = e3 + 2;
|
|
1000
|
+
} else {
|
|
1001
|
+
let s3 = it(t2, r2, this.options.removeNSPrefix);
|
|
1002
|
+
if (!s3) {
|
|
1003
|
+
const e3 = t2.substring(Math.max(0, r2 - 50), Math.min(t2.length, r2 + 50));
|
|
1004
|
+
throw new Error(`readTagExp returned undefined at position ${r2}. Context: "${e3}"`);
|
|
1005
|
+
}
|
|
1006
|
+
let o2 = s3.tagName;
|
|
1007
|
+
const a2 = s3.rawTagName;
|
|
1008
|
+
let { tagExp: h2, attrExpPresent: l2, closeIndex: p2 } = s3;
|
|
1009
|
+
if ({ tagName: o2, tagExp: h2 } = ot(this.options.transformTagName, o2, h2, this.options), this.options.strictReservedNames && (o2 === this.options.commentPropName || o2 === this.options.cdataPropName || o2 === this.options.textNodeName || o2 === this.options.attributesGroupName))
|
|
1010
|
+
throw new Error(`Invalid tag name: ${o2}`);
|
|
1011
|
+
i2 && n2 && i2.tagname !== "!xml" && (n2 = this.saveTextToParentTag(n2, i2, this.readonlyMatcher, false));
|
|
1012
|
+
const u2 = i2;
|
|
1013
|
+
u2 && this.options.unpairedTags.indexOf(u2.tagname) !== -1 && (i2 = this.tagsNodeStack.pop(), this.matcher.pop());
|
|
1014
|
+
let c2 = false;
|
|
1015
|
+
h2.length > 0 && h2.lastIndexOf("/") === h2.length - 1 && (c2 = true, o2[o2.length - 1] === "/" ? (o2 = o2.substr(0, o2.length - 1), h2 = o2) : h2 = h2.substr(0, h2.length - 1), l2 = o2 !== h2);
|
|
1016
|
+
let d2, f2 = null, g2 = {};
|
|
1017
|
+
d2 = B(a2), o2 !== e2.tagname && this.matcher.push(o2, {}, d2), o2 !== h2 && l2 && (f2 = this.buildAttributesMap(h2, this.matcher, o2), f2 && (g2 = U(f2, this.options))), o2 !== e2.tagname && (this.isCurrentNodeStopNode = this.isItStopNode(this.stopNodeExpressions, this.matcher));
|
|
1018
|
+
const m2 = r2;
|
|
1019
|
+
if (this.isCurrentNodeStopNode) {
|
|
1020
|
+
let e3 = "";
|
|
1021
|
+
if (c2)
|
|
1022
|
+
r2 = s3.closeIndex;
|
|
1023
|
+
else if (this.options.unpairedTags.indexOf(o2) !== -1)
|
|
1024
|
+
r2 = s3.closeIndex;
|
|
1025
|
+
else {
|
|
1026
|
+
const i3 = this.readStopNodeData(t2, a2, p2 + 1);
|
|
1027
|
+
if (!i3)
|
|
1028
|
+
throw new Error(`Unexpected end of ${a2}`);
|
|
1029
|
+
r2 = i3.i, e3 = i3.tagContent;
|
|
1030
|
+
}
|
|
1031
|
+
const n3 = new $(o2);
|
|
1032
|
+
f2 && (n3[":@"] = f2), n3.add(this.options.textNodeName, e3), this.matcher.pop(), this.isCurrentNodeStopNode = false, this.addChild(i2, n3, this.readonlyMatcher, m2);
|
|
1033
|
+
} else {
|
|
1034
|
+
if (c2) {
|
|
1035
|
+
({ tagName: o2, tagExp: h2 } = ot(this.options.transformTagName, o2, h2, this.options));
|
|
1036
|
+
const t3 = new $(o2);
|
|
1037
|
+
f2 && (t3[":@"] = f2), this.addChild(i2, t3, this.readonlyMatcher, m2), this.matcher.pop(), this.isCurrentNodeStopNode = false;
|
|
1038
|
+
} else {
|
|
1039
|
+
if (this.options.unpairedTags.indexOf(o2) !== -1) {
|
|
1040
|
+
const t3 = new $(o2);
|
|
1041
|
+
f2 && (t3[":@"] = f2), this.addChild(i2, t3, this.readonlyMatcher, m2), this.matcher.pop(), this.isCurrentNodeStopNode = false, r2 = s3.closeIndex;
|
|
1042
|
+
continue;
|
|
1043
|
+
}
|
|
1044
|
+
{
|
|
1045
|
+
const t3 = new $(o2);
|
|
1046
|
+
if (this.tagsNodeStack.length > this.options.maxNestedTags)
|
|
1047
|
+
throw new Error("Maximum nested tags exceeded");
|
|
1048
|
+
this.tagsNodeStack.push(i2), f2 && (t3[":@"] = f2), this.addChild(i2, t3, this.readonlyMatcher, m2), i2 = t3;
|
|
1049
|
+
}
|
|
1050
|
+
}
|
|
1051
|
+
n2 = "", r2 = p2;
|
|
1052
|
+
}
|
|
1053
|
+
}
|
|
1054
|
+
else
|
|
1055
|
+
n2 += t2[r2];
|
|
1056
|
+
return e2.child;
|
|
1057
|
+
};
|
|
1058
|
+
function K(t2, e2, i2, n2) {
|
|
1059
|
+
this.options.captureMetaData || (n2 = undefined);
|
|
1060
|
+
const s2 = this.options.jPath ? i2.toString() : i2, r2 = this.options.updateTag(e2.tagname, s2, e2[":@"]);
|
|
1061
|
+
r2 === false || (typeof r2 == "string" ? (e2.tagname = r2, t2.addChild(e2, n2)) : t2.addChild(e2, n2));
|
|
1062
|
+
}
|
|
1063
|
+
function Q(t2, e2, i2) {
|
|
1064
|
+
const n2 = this.options.processEntities;
|
|
1065
|
+
if (!n2 || !n2.enabled)
|
|
1066
|
+
return t2;
|
|
1067
|
+
if (n2.allowedTags) {
|
|
1068
|
+
const s2 = this.options.jPath ? i2.toString() : i2;
|
|
1069
|
+
if (!(Array.isArray(n2.allowedTags) ? n2.allowedTags.includes(e2) : n2.allowedTags(e2, s2)))
|
|
1070
|
+
return t2;
|
|
1071
|
+
}
|
|
1072
|
+
if (n2.tagFilter) {
|
|
1073
|
+
const s2 = this.options.jPath ? i2.toString() : i2;
|
|
1074
|
+
if (!n2.tagFilter(e2, s2))
|
|
1075
|
+
return t2;
|
|
1076
|
+
}
|
|
1077
|
+
for (const e3 of Object.keys(this.docTypeEntities)) {
|
|
1078
|
+
const i3 = this.docTypeEntities[e3], s2 = t2.match(i3.regx);
|
|
1079
|
+
if (s2) {
|
|
1080
|
+
if (this.entityExpansionCount += s2.length, n2.maxTotalExpansions && this.entityExpansionCount > n2.maxTotalExpansions)
|
|
1081
|
+
throw new Error(`Entity expansion limit exceeded: ${this.entityExpansionCount} > ${n2.maxTotalExpansions}`);
|
|
1082
|
+
const e4 = t2.length;
|
|
1083
|
+
if (t2 = t2.replace(i3.regx, i3.val), n2.maxExpandedLength && (this.currentExpandedLength += t2.length - e4, this.currentExpandedLength > n2.maxExpandedLength))
|
|
1084
|
+
throw new Error(`Total expanded content size exceeded: ${this.currentExpandedLength} > ${n2.maxExpandedLength}`);
|
|
1085
|
+
}
|
|
1086
|
+
}
|
|
1087
|
+
for (const e3 of Object.keys(this.lastEntities)) {
|
|
1088
|
+
const i3 = this.lastEntities[e3], s2 = t2.match(i3.regex);
|
|
1089
|
+
if (s2 && (this.entityExpansionCount += s2.length, n2.maxTotalExpansions && this.entityExpansionCount > n2.maxTotalExpansions))
|
|
1090
|
+
throw new Error(`Entity expansion limit exceeded: ${this.entityExpansionCount} > ${n2.maxTotalExpansions}`);
|
|
1091
|
+
t2 = t2.replace(i3.regex, i3.val);
|
|
1092
|
+
}
|
|
1093
|
+
if (t2.indexOf("&") === -1)
|
|
1094
|
+
return t2;
|
|
1095
|
+
if (this.options.htmlEntities)
|
|
1096
|
+
for (const e3 of Object.keys(this.htmlEntities)) {
|
|
1097
|
+
const i3 = this.htmlEntities[e3], s2 = t2.match(i3.regex);
|
|
1098
|
+
if (s2 && (this.entityExpansionCount += s2.length, n2.maxTotalExpansions && this.entityExpansionCount > n2.maxTotalExpansions))
|
|
1099
|
+
throw new Error(`Entity expansion limit exceeded: ${this.entityExpansionCount} > ${n2.maxTotalExpansions}`);
|
|
1100
|
+
t2 = t2.replace(i3.regex, i3.val);
|
|
1101
|
+
}
|
|
1102
|
+
return t2.replace(this.ampEntity.regex, this.ampEntity.val);
|
|
1103
|
+
}
|
|
1104
|
+
function H(t2, e2, i2, n2) {
|
|
1105
|
+
return t2 && (n2 === undefined && (n2 = e2.child.length === 0), (t2 = this.parseTextData(t2, e2.tagname, i2, false, !!e2[":@"] && Object.keys(e2[":@"]).length !== 0, n2)) !== undefined && t2 !== "" && e2.add(this.options.textNodeName, t2), t2 = ""), t2;
|
|
1106
|
+
}
|
|
1107
|
+
function tt(t2, e2) {
|
|
1108
|
+
if (!t2 || t2.length === 0)
|
|
1109
|
+
return false;
|
|
1110
|
+
for (let i2 = 0;i2 < t2.length; i2++)
|
|
1111
|
+
if (e2.matches(t2[i2]))
|
|
1112
|
+
return true;
|
|
1113
|
+
return false;
|
|
1114
|
+
}
|
|
1115
|
+
function et(t2, e2, i2, n2) {
|
|
1116
|
+
const s2 = t2.indexOf(e2, i2);
|
|
1117
|
+
if (s2 === -1)
|
|
1118
|
+
throw new Error(n2);
|
|
1119
|
+
return s2 + e2.length - 1;
|
|
1120
|
+
}
|
|
1121
|
+
function it(t2, e2, i2, n2 = ">") {
|
|
1122
|
+
const s2 = function(t3, e3, i3 = ">") {
|
|
1123
|
+
let n3, s3 = "";
|
|
1124
|
+
for (let r3 = e3;r3 < t3.length; r3++) {
|
|
1125
|
+
let e4 = t3[r3];
|
|
1126
|
+
if (n3)
|
|
1127
|
+
e4 === n3 && (n3 = "");
|
|
1128
|
+
else if (e4 === '"' || e4 === "'")
|
|
1129
|
+
n3 = e4;
|
|
1130
|
+
else if (e4 === i3[0]) {
|
|
1131
|
+
if (!i3[1])
|
|
1132
|
+
return { data: s3, index: r3 };
|
|
1133
|
+
if (t3[r3 + 1] === i3[1])
|
|
1134
|
+
return { data: s3, index: r3 };
|
|
1135
|
+
} else
|
|
1136
|
+
e4 === "\t" && (e4 = " ");
|
|
1137
|
+
s3 += e4;
|
|
1138
|
+
}
|
|
1139
|
+
}(t2, e2 + 1, n2);
|
|
1140
|
+
if (!s2)
|
|
1141
|
+
return;
|
|
1142
|
+
let r2 = s2.data;
|
|
1143
|
+
const o2 = s2.index, a2 = r2.search(/\s/);
|
|
1144
|
+
let h2 = r2, l2 = true;
|
|
1145
|
+
a2 !== -1 && (h2 = r2.substring(0, a2), r2 = r2.substring(a2 + 1).trimStart());
|
|
1146
|
+
const p2 = h2;
|
|
1147
|
+
if (i2) {
|
|
1148
|
+
const t3 = h2.indexOf(":");
|
|
1149
|
+
t3 !== -1 && (h2 = h2.substr(t3 + 1), l2 = h2 !== s2.data.substr(t3 + 1));
|
|
1150
|
+
}
|
|
1151
|
+
return { tagName: h2, tagExp: r2, closeIndex: o2, attrExpPresent: l2, rawTagName: p2 };
|
|
1152
|
+
}
|
|
1153
|
+
function nt(t2, e2, i2) {
|
|
1154
|
+
const n2 = i2;
|
|
1155
|
+
let s2 = 1;
|
|
1156
|
+
for (;i2 < t2.length; i2++)
|
|
1157
|
+
if (t2[i2] === "<")
|
|
1158
|
+
if (t2[i2 + 1] === "/") {
|
|
1159
|
+
const r2 = et(t2, ">", i2, `${e2} is not closed`);
|
|
1160
|
+
if (t2.substring(i2 + 2, r2).trim() === e2 && (s2--, s2 === 0))
|
|
1161
|
+
return { tagContent: t2.substring(n2, i2), i: r2 };
|
|
1162
|
+
i2 = r2;
|
|
1163
|
+
} else if (t2[i2 + 1] === "?")
|
|
1164
|
+
i2 = et(t2, "?>", i2 + 1, "StopNode is not closed.");
|
|
1165
|
+
else if (t2.substr(i2 + 1, 3) === "!--")
|
|
1166
|
+
i2 = et(t2, "-->", i2 + 3, "StopNode is not closed.");
|
|
1167
|
+
else if (t2.substr(i2 + 1, 2) === "![")
|
|
1168
|
+
i2 = et(t2, "]]>", i2, "StopNode is not closed.") - 2;
|
|
1169
|
+
else {
|
|
1170
|
+
const n3 = it(t2, i2, ">");
|
|
1171
|
+
n3 && ((n3 && n3.tagName) === e2 && n3.tagExp[n3.tagExp.length - 1] !== "/" && s2++, i2 = n3.closeIndex);
|
|
1172
|
+
}
|
|
1173
|
+
}
|
|
1174
|
+
function st(t2, e2, i2) {
|
|
1175
|
+
if (e2 && typeof t2 == "string") {
|
|
1176
|
+
const e3 = t2.trim();
|
|
1177
|
+
return e3 === "true" || e3 !== "false" && function(t3, e4 = {}) {
|
|
1178
|
+
if (e4 = Object.assign({}, k, e4), !t3 || typeof t3 != "string")
|
|
1179
|
+
return t3;
|
|
1180
|
+
let i3 = t3.trim();
|
|
1181
|
+
if (e4.skipLike !== undefined && e4.skipLike.test(i3))
|
|
1182
|
+
return t3;
|
|
1183
|
+
if (t3 === "0")
|
|
1184
|
+
return 0;
|
|
1185
|
+
if (e4.hex && D.test(i3))
|
|
1186
|
+
return function(t4) {
|
|
1187
|
+
if (parseInt)
|
|
1188
|
+
return parseInt(t4, 16);
|
|
1189
|
+
if (Number.parseInt)
|
|
1190
|
+
return Number.parseInt(t4, 16);
|
|
1191
|
+
if (window && window.parseInt)
|
|
1192
|
+
return window.parseInt(t4, 16);
|
|
1193
|
+
throw new Error("parseInt, Number.parseInt, window.parseInt are not supported");
|
|
1194
|
+
}(i3);
|
|
1195
|
+
if (isFinite(i3)) {
|
|
1196
|
+
if (i3.includes("e") || i3.includes("E"))
|
|
1197
|
+
return function(t4, e5, i4) {
|
|
1198
|
+
if (!i4.eNotation)
|
|
1199
|
+
return t4;
|
|
1200
|
+
const n3 = e5.match(F);
|
|
1201
|
+
if (n3) {
|
|
1202
|
+
let s2 = n3[1] || "";
|
|
1203
|
+
const r2 = n3[3].indexOf("e") === -1 ? "E" : "e", o2 = n3[2], a2 = s2 ? t4[o2.length + 1] === r2 : t4[o2.length] === r2;
|
|
1204
|
+
return o2.length > 1 && a2 ? t4 : (o2.length !== 1 || !n3[3].startsWith(`.${r2}`) && n3[3][0] !== r2) && o2.length > 0 ? i4.leadingZeros && !a2 ? (e5 = (n3[1] || "") + n3[3], Number(e5)) : t4 : Number(e5);
|
|
1205
|
+
}
|
|
1206
|
+
return t4;
|
|
1207
|
+
}(t3, i3, e4);
|
|
1208
|
+
{
|
|
1209
|
+
const s2 = V.exec(i3);
|
|
1210
|
+
if (s2) {
|
|
1211
|
+
const r2 = s2[1] || "", o2 = s2[2];
|
|
1212
|
+
let a2 = (n2 = s2[3]) && n2.indexOf(".") !== -1 ? ((n2 = n2.replace(/0+$/, "")) === "." ? n2 = "0" : n2[0] === "." ? n2 = "0" + n2 : n2[n2.length - 1] === "." && (n2 = n2.substring(0, n2.length - 1)), n2) : n2;
|
|
1213
|
+
const h2 = r2 ? t3[o2.length + 1] === "." : t3[o2.length] === ".";
|
|
1214
|
+
if (!e4.leadingZeros && (o2.length > 1 || o2.length === 1 && !h2))
|
|
1215
|
+
return t3;
|
|
1216
|
+
{
|
|
1217
|
+
const n3 = Number(i3), s3 = String(n3);
|
|
1218
|
+
if (n3 === 0)
|
|
1219
|
+
return n3;
|
|
1220
|
+
if (s3.search(/[eE]/) !== -1)
|
|
1221
|
+
return e4.eNotation ? n3 : t3;
|
|
1222
|
+
if (i3.indexOf(".") !== -1)
|
|
1223
|
+
return s3 === "0" || s3 === a2 || s3 === `${r2}${a2}` ? n3 : t3;
|
|
1224
|
+
let h3 = o2 ? a2 : i3;
|
|
1225
|
+
return o2 ? h3 === s3 || r2 + h3 === s3 ? n3 : t3 : h3 === s3 || h3 === r2 + s3 ? n3 : t3;
|
|
1226
|
+
}
|
|
1227
|
+
}
|
|
1228
|
+
return t3;
|
|
1229
|
+
}
|
|
1230
|
+
}
|
|
1231
|
+
var n2;
|
|
1232
|
+
return function(t4, e5, i4) {
|
|
1233
|
+
const n3 = e5 === 1 / 0;
|
|
1234
|
+
switch (i4.infinity.toLowerCase()) {
|
|
1235
|
+
case "null":
|
|
1236
|
+
return null;
|
|
1237
|
+
case "infinity":
|
|
1238
|
+
return e5;
|
|
1239
|
+
case "string":
|
|
1240
|
+
return n3 ? "Infinity" : "-Infinity";
|
|
1241
|
+
default:
|
|
1242
|
+
return t4;
|
|
1243
|
+
}
|
|
1244
|
+
}(t3, Number(i3), e4);
|
|
1245
|
+
}(t2, i2);
|
|
1246
|
+
}
|
|
1247
|
+
return t2 !== undefined ? t2 : "";
|
|
1248
|
+
}
|
|
1249
|
+
function rt(t2, e2, i2) {
|
|
1250
|
+
const n2 = Number.parseInt(t2, e2);
|
|
1251
|
+
return n2 >= 0 && n2 <= 1114111 ? String.fromCodePoint(n2) : i2 + t2 + ";";
|
|
1252
|
+
}
|
|
1253
|
+
function ot(t2, e2, i2, n2) {
|
|
1254
|
+
if (t2) {
|
|
1255
|
+
const n3 = t2(e2);
|
|
1256
|
+
i2 === e2 && (i2 = n3), e2 = n3;
|
|
1257
|
+
}
|
|
1258
|
+
return { tagName: e2 = at(e2, n2), tagExp: i2 };
|
|
1259
|
+
}
|
|
1260
|
+
function at(t2, e2) {
|
|
1261
|
+
if (a.includes(t2))
|
|
1262
|
+
throw new Error(`[SECURITY] Invalid name: "${t2}" is a reserved JavaScript keyword that could cause prototype pollution`);
|
|
1263
|
+
return o.includes(t2) ? e2.onDangerousProperty(t2) : t2;
|
|
1264
|
+
}
|
|
1265
|
+
const ht = $.getMetaDataSymbol();
|
|
1266
|
+
function lt(t2, e2) {
|
|
1267
|
+
if (!t2 || typeof t2 != "object")
|
|
1268
|
+
return {};
|
|
1269
|
+
if (!e2)
|
|
1270
|
+
return t2;
|
|
1271
|
+
const i2 = {};
|
|
1272
|
+
for (const n2 in t2)
|
|
1273
|
+
n2.startsWith(e2) ? i2[n2.substring(e2.length)] = t2[n2] : i2[n2] = t2[n2];
|
|
1274
|
+
return i2;
|
|
1275
|
+
}
|
|
1276
|
+
function pt(t2, e2, i2, n2) {
|
|
1277
|
+
return ut(t2, e2, i2, n2);
|
|
1278
|
+
}
|
|
1279
|
+
function ut(t2, e2, i2, n2) {
|
|
1280
|
+
let s2;
|
|
1281
|
+
const r2 = {};
|
|
1282
|
+
for (let o2 = 0;o2 < t2.length; o2++) {
|
|
1283
|
+
const a2 = t2[o2], h2 = ct(a2);
|
|
1284
|
+
if (h2 !== undefined && h2 !== e2.textNodeName) {
|
|
1285
|
+
const t3 = lt(a2[":@"] || {}, e2.attributeNamePrefix);
|
|
1286
|
+
i2.push(h2, t3);
|
|
1287
|
+
}
|
|
1288
|
+
if (h2 === e2.textNodeName)
|
|
1289
|
+
s2 === undefined ? s2 = a2[h2] : s2 += "" + a2[h2];
|
|
1290
|
+
else {
|
|
1291
|
+
if (h2 === undefined)
|
|
1292
|
+
continue;
|
|
1293
|
+
if (a2[h2]) {
|
|
1294
|
+
let t3 = ut(a2[h2], e2, i2, n2);
|
|
1295
|
+
const s3 = ft(t3, e2);
|
|
1296
|
+
if (a2[":@"] ? dt(t3, a2[":@"], n2, e2) : Object.keys(t3).length !== 1 || t3[e2.textNodeName] === undefined || e2.alwaysCreateTextNode ? Object.keys(t3).length === 0 && (e2.alwaysCreateTextNode ? t3[e2.textNodeName] = "" : t3 = "") : t3 = t3[e2.textNodeName], a2[ht] !== undefined && typeof t3 == "object" && t3 !== null && (t3[ht] = a2[ht]), r2[h2] !== undefined && Object.prototype.hasOwnProperty.call(r2, h2))
|
|
1297
|
+
Array.isArray(r2[h2]) || (r2[h2] = [r2[h2]]), r2[h2].push(t3);
|
|
1298
|
+
else {
|
|
1299
|
+
const i3 = e2.jPath ? n2.toString() : n2;
|
|
1300
|
+
e2.isArray(h2, i3, s3) ? r2[h2] = [t3] : r2[h2] = t3;
|
|
1301
|
+
}
|
|
1302
|
+
h2 !== undefined && h2 !== e2.textNodeName && i2.pop();
|
|
1303
|
+
}
|
|
1304
|
+
}
|
|
1305
|
+
}
|
|
1306
|
+
return typeof s2 == "string" ? s2.length > 0 && (r2[e2.textNodeName] = s2) : s2 !== undefined && (r2[e2.textNodeName] = s2), r2;
|
|
1307
|
+
}
|
|
1308
|
+
function ct(t2) {
|
|
1309
|
+
const e2 = Object.keys(t2);
|
|
1310
|
+
for (let t3 = 0;t3 < e2.length; t3++) {
|
|
1311
|
+
const i2 = e2[t3];
|
|
1312
|
+
if (i2 !== ":@")
|
|
1313
|
+
return i2;
|
|
1314
|
+
}
|
|
1315
|
+
}
|
|
1316
|
+
function dt(t2, e2, i2, n2) {
|
|
1317
|
+
if (e2) {
|
|
1318
|
+
const s2 = Object.keys(e2), r2 = s2.length;
|
|
1319
|
+
for (let o2 = 0;o2 < r2; o2++) {
|
|
1320
|
+
const r3 = s2[o2], a2 = r3.startsWith(n2.attributeNamePrefix) ? r3.substring(n2.attributeNamePrefix.length) : r3, h2 = n2.jPath ? i2.toString() + "." + a2 : i2;
|
|
1321
|
+
n2.isArray(r3, h2, true, true) ? t2[r3] = [e2[r3]] : t2[r3] = e2[r3];
|
|
1322
|
+
}
|
|
1323
|
+
}
|
|
1324
|
+
}
|
|
1325
|
+
function ft(t2, e2) {
|
|
1326
|
+
const { textNodeName: i2 } = e2, n2 = Object.keys(t2).length;
|
|
1327
|
+
return n2 === 0 || !(n2 !== 1 || !t2[i2] && typeof t2[i2] != "boolean" && t2[i2] !== 0);
|
|
1328
|
+
}
|
|
1329
|
+
|
|
1330
|
+
class gt {
|
|
1331
|
+
constructor(t2) {
|
|
1332
|
+
this.externalEntities = {}, this.options = O(t2);
|
|
1333
|
+
}
|
|
1334
|
+
parse(t2, e2) {
|
|
1335
|
+
if (typeof t2 != "string" && t2.toString)
|
|
1336
|
+
t2 = t2.toString();
|
|
1337
|
+
else if (typeof t2 != "string")
|
|
1338
|
+
throw new Error("XML data is accepted in String or Bytes[] form.");
|
|
1339
|
+
if (e2) {
|
|
1340
|
+
e2 === true && (e2 = {});
|
|
1341
|
+
const i3 = l(t2, e2);
|
|
1342
|
+
if (i3 !== true)
|
|
1343
|
+
throw Error(`${i3.err.msg}:${i3.err.line}:${i3.err.col}`);
|
|
1344
|
+
}
|
|
1345
|
+
const i2 = new W(this.options);
|
|
1346
|
+
i2.addExternalEntities(this.externalEntities);
|
|
1347
|
+
const n2 = i2.parseXml(t2);
|
|
1348
|
+
return this.options.preserveOrder || n2 === undefined ? n2 : pt(n2, this.options, i2.matcher, i2.readonlyMatcher);
|
|
1349
|
+
}
|
|
1350
|
+
addEntity(t2, e2) {
|
|
1351
|
+
if (e2.indexOf("&") !== -1)
|
|
1352
|
+
throw new Error("Entity value can't have '&'");
|
|
1353
|
+
if (t2.indexOf("&") !== -1 || t2.indexOf(";") !== -1)
|
|
1354
|
+
throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '
'");
|
|
1355
|
+
if (e2 === "&")
|
|
1356
|
+
throw new Error("An entity with value '&' is not permitted");
|
|
1357
|
+
this.externalEntities[t2] = e2;
|
|
1358
|
+
}
|
|
1359
|
+
static getMetaDataSymbol() {
|
|
1360
|
+
return $.getMetaDataSymbol();
|
|
1361
|
+
}
|
|
1362
|
+
}
|
|
1363
|
+
function mt(t2, e2) {
|
|
1364
|
+
let i2 = "";
|
|
1365
|
+
e2.format && e2.indentBy.length > 0 && (i2 = `
|
|
1366
|
+
`);
|
|
1367
|
+
const n2 = [];
|
|
1368
|
+
if (e2.stopNodes && Array.isArray(e2.stopNodes))
|
|
1369
|
+
for (let t3 = 0;t3 < e2.stopNodes.length; t3++) {
|
|
1370
|
+
const i3 = e2.stopNodes[t3];
|
|
1371
|
+
typeof i3 == "string" ? n2.push(new R(i3)) : i3 instanceof R && n2.push(i3);
|
|
1372
|
+
}
|
|
1373
|
+
return xt(t2, e2, i2, new G, n2);
|
|
1374
|
+
}
|
|
1375
|
+
function xt(t2, e2, i2, n2, s2) {
|
|
1376
|
+
let r2 = "", o2 = false;
|
|
1377
|
+
if (e2.maxNestedTags && n2.getDepth() > e2.maxNestedTags)
|
|
1378
|
+
throw new Error("Maximum nested tags exceeded");
|
|
1379
|
+
if (!Array.isArray(t2)) {
|
|
1380
|
+
if (t2 != null) {
|
|
1381
|
+
let i3 = t2.toString();
|
|
1382
|
+
return i3 = Tt(i3, e2), i3;
|
|
1383
|
+
}
|
|
1384
|
+
return "";
|
|
1385
|
+
}
|
|
1386
|
+
for (let a2 = 0;a2 < t2.length; a2++) {
|
|
1387
|
+
const h2 = t2[a2], l2 = yt(h2);
|
|
1388
|
+
if (l2 === undefined)
|
|
1389
|
+
continue;
|
|
1390
|
+
const p2 = Nt(h2[":@"], e2);
|
|
1391
|
+
n2.push(l2, p2);
|
|
1392
|
+
const u2 = vt(n2, s2);
|
|
1393
|
+
if (l2 === e2.textNodeName) {
|
|
1394
|
+
let t3 = h2[l2];
|
|
1395
|
+
u2 || (t3 = e2.tagValueProcessor(l2, t3), t3 = Tt(t3, e2)), o2 && (r2 += i2), r2 += t3, o2 = false, n2.pop();
|
|
1396
|
+
continue;
|
|
1397
|
+
}
|
|
1398
|
+
if (l2 === e2.cdataPropName) {
|
|
1399
|
+
o2 && (r2 += i2), r2 += `<![CDATA[${h2[l2][0][e2.textNodeName]}]]>`, o2 = false, n2.pop();
|
|
1400
|
+
continue;
|
|
1401
|
+
}
|
|
1402
|
+
if (l2 === e2.commentPropName) {
|
|
1403
|
+
r2 += i2 + `<!--${h2[l2][0][e2.textNodeName]}-->`, o2 = true, n2.pop();
|
|
1404
|
+
continue;
|
|
1405
|
+
}
|
|
1406
|
+
if (l2[0] === "?") {
|
|
1407
|
+
const t3 = wt(h2[":@"], e2, u2), s3 = l2 === "?xml" ? "" : i2;
|
|
1408
|
+
let a3 = h2[l2][0][e2.textNodeName];
|
|
1409
|
+
a3 = a3.length !== 0 ? " " + a3 : "", r2 += s3 + `<${l2}${a3}${t3}?>`, o2 = true, n2.pop();
|
|
1410
|
+
continue;
|
|
1411
|
+
}
|
|
1412
|
+
let c2 = i2;
|
|
1413
|
+
c2 !== "" && (c2 += e2.indentBy);
|
|
1414
|
+
const d2 = i2 + `<${l2}${wt(h2[":@"], e2, u2)}`;
|
|
1415
|
+
let f2;
|
|
1416
|
+
f2 = u2 ? bt(h2[l2], e2) : xt(h2[l2], e2, c2, n2, s2), e2.unpairedTags.indexOf(l2) !== -1 ? e2.suppressUnpairedNode ? r2 += d2 + ">" : r2 += d2 + "/>" : f2 && f2.length !== 0 || !e2.suppressEmptyNode ? f2 && f2.endsWith(">") ? r2 += d2 + `>${f2}${i2}</${l2}>` : (r2 += d2 + ">", f2 && i2 !== "" && (f2.includes("/>") || f2.includes("</")) ? r2 += i2 + e2.indentBy + f2 + i2 : r2 += f2, r2 += `</${l2}>`) : r2 += d2 + "/>", o2 = true, n2.pop();
|
|
1417
|
+
}
|
|
1418
|
+
return r2;
|
|
1419
|
+
}
|
|
1420
|
+
function Nt(t2, e2) {
|
|
1421
|
+
if (!t2 || e2.ignoreAttributes)
|
|
1422
|
+
return null;
|
|
1423
|
+
const i2 = {};
|
|
1424
|
+
let n2 = false;
|
|
1425
|
+
for (let s2 in t2)
|
|
1426
|
+
Object.prototype.hasOwnProperty.call(t2, s2) && (i2[s2.startsWith(e2.attributeNamePrefix) ? s2.substr(e2.attributeNamePrefix.length) : s2] = t2[s2], n2 = true);
|
|
1427
|
+
return n2 ? i2 : null;
|
|
1428
|
+
}
|
|
1429
|
+
function bt(t2, e2) {
|
|
1430
|
+
if (!Array.isArray(t2))
|
|
1431
|
+
return t2 != null ? t2.toString() : "";
|
|
1432
|
+
let i2 = "";
|
|
1433
|
+
for (let n2 = 0;n2 < t2.length; n2++) {
|
|
1434
|
+
const s2 = t2[n2], r2 = yt(s2);
|
|
1435
|
+
if (r2 === e2.textNodeName)
|
|
1436
|
+
i2 += s2[r2];
|
|
1437
|
+
else if (r2 === e2.cdataPropName)
|
|
1438
|
+
i2 += s2[r2][0][e2.textNodeName];
|
|
1439
|
+
else if (r2 === e2.commentPropName)
|
|
1440
|
+
i2 += s2[r2][0][e2.textNodeName];
|
|
1441
|
+
else {
|
|
1442
|
+
if (r2 && r2[0] === "?")
|
|
1443
|
+
continue;
|
|
1444
|
+
if (r2) {
|
|
1445
|
+
const t3 = Et(s2[":@"], e2), n3 = bt(s2[r2], e2);
|
|
1446
|
+
n3 && n3.length !== 0 ? i2 += `<${r2}${t3}>${n3}</${r2}>` : i2 += `<${r2}${t3}/>`;
|
|
1447
|
+
}
|
|
1448
|
+
}
|
|
1449
|
+
}
|
|
1450
|
+
return i2;
|
|
1451
|
+
}
|
|
1452
|
+
function Et(t2, e2) {
|
|
1453
|
+
let i2 = "";
|
|
1454
|
+
if (t2 && !e2.ignoreAttributes)
|
|
1455
|
+
for (let n2 in t2) {
|
|
1456
|
+
if (!Object.prototype.hasOwnProperty.call(t2, n2))
|
|
1457
|
+
continue;
|
|
1458
|
+
let s2 = t2[n2];
|
|
1459
|
+
s2 === true && e2.suppressBooleanAttributes ? i2 += ` ${n2.substr(e2.attributeNamePrefix.length)}` : i2 += ` ${n2.substr(e2.attributeNamePrefix.length)}="${s2}"`;
|
|
1460
|
+
}
|
|
1461
|
+
return i2;
|
|
1462
|
+
}
|
|
1463
|
+
function yt(t2) {
|
|
1464
|
+
const e2 = Object.keys(t2);
|
|
1465
|
+
for (let i2 = 0;i2 < e2.length; i2++) {
|
|
1466
|
+
const n2 = e2[i2];
|
|
1467
|
+
if (Object.prototype.hasOwnProperty.call(t2, n2) && n2 !== ":@")
|
|
1468
|
+
return n2;
|
|
1469
|
+
}
|
|
1470
|
+
}
|
|
1471
|
+
function wt(t2, e2, i2) {
|
|
1472
|
+
let n2 = "";
|
|
1473
|
+
if (t2 && !e2.ignoreAttributes)
|
|
1474
|
+
for (let s2 in t2) {
|
|
1475
|
+
if (!Object.prototype.hasOwnProperty.call(t2, s2))
|
|
1476
|
+
continue;
|
|
1477
|
+
let r2;
|
|
1478
|
+
i2 ? r2 = t2[s2] : (r2 = e2.attributeValueProcessor(s2, t2[s2]), r2 = Tt(r2, e2)), r2 === true && e2.suppressBooleanAttributes ? n2 += ` ${s2.substr(e2.attributeNamePrefix.length)}` : n2 += ` ${s2.substr(e2.attributeNamePrefix.length)}="${r2}"`;
|
|
1479
|
+
}
|
|
1480
|
+
return n2;
|
|
1481
|
+
}
|
|
1482
|
+
function vt(t2, e2) {
|
|
1483
|
+
if (!e2 || e2.length === 0)
|
|
1484
|
+
return false;
|
|
1485
|
+
for (let i2 = 0;i2 < e2.length; i2++)
|
|
1486
|
+
if (t2.matches(e2[i2]))
|
|
1487
|
+
return true;
|
|
1488
|
+
return false;
|
|
1489
|
+
}
|
|
1490
|
+
function Tt(t2, e2) {
|
|
1491
|
+
if (t2 && t2.length > 0 && e2.processEntities)
|
|
1492
|
+
for (let i2 = 0;i2 < e2.entities.length; i2++) {
|
|
1493
|
+
const n2 = e2.entities[i2];
|
|
1494
|
+
t2 = t2.replace(n2.regex, n2.val);
|
|
1495
|
+
}
|
|
1496
|
+
return t2;
|
|
1497
|
+
}
|
|
1498
|
+
const Pt = { attributeNamePrefix: "@_", attributesGroupName: false, textNodeName: "#text", ignoreAttributes: true, cdataPropName: false, format: false, indentBy: " ", suppressEmptyNode: false, suppressUnpairedNode: true, suppressBooleanAttributes: true, tagValueProcessor: function(t2, e2) {
|
|
1499
|
+
return e2;
|
|
1500
|
+
}, attributeValueProcessor: function(t2, e2) {
|
|
1501
|
+
return e2;
|
|
1502
|
+
}, preserveOrder: false, commentPropName: false, unpairedTags: [], entities: [{ regex: new RegExp("&", "g"), val: "&" }, { regex: new RegExp(">", "g"), val: ">" }, { regex: new RegExp("<", "g"), val: "<" }, { regex: new RegExp("'", "g"), val: "'" }, { regex: new RegExp('"', "g"), val: """ }], processEntities: true, stopNodes: [], oneListGroup: false, maxNestedTags: 100, jPath: true };
|
|
1503
|
+
function St(t2) {
|
|
1504
|
+
if (this.options = Object.assign({}, Pt, t2), this.options.stopNodes && Array.isArray(this.options.stopNodes) && (this.options.stopNodes = this.options.stopNodes.map((t3) => typeof t3 == "string" && t3.startsWith("*.") ? ".." + t3.substring(2) : t3)), this.stopNodeExpressions = [], this.options.stopNodes && Array.isArray(this.options.stopNodes))
|
|
1505
|
+
for (let t3 = 0;t3 < this.options.stopNodes.length; t3++) {
|
|
1506
|
+
const e3 = this.options.stopNodes[t3];
|
|
1507
|
+
typeof e3 == "string" ? this.stopNodeExpressions.push(new R(e3)) : e3 instanceof R && this.stopNodeExpressions.push(e3);
|
|
1508
|
+
}
|
|
1509
|
+
var e2;
|
|
1510
|
+
this.options.ignoreAttributes === true || this.options.attributesGroupName ? this.isAttribute = function() {
|
|
1511
|
+
return false;
|
|
1512
|
+
} : (this.ignoreAttributesFn = typeof (e2 = this.options.ignoreAttributes) == "function" ? e2 : Array.isArray(e2) ? (t3) => {
|
|
1513
|
+
for (const i2 of e2) {
|
|
1514
|
+
if (typeof i2 == "string" && t3 === i2)
|
|
1515
|
+
return true;
|
|
1516
|
+
if (i2 instanceof RegExp && i2.test(t3))
|
|
1517
|
+
return true;
|
|
1518
|
+
}
|
|
1519
|
+
} : () => false, this.attrPrefixLen = this.options.attributeNamePrefix.length, this.isAttribute = Ct), this.processTextOrObjNode = At, this.options.format ? (this.indentate = Ot, this.tagEndChar = `>
|
|
1520
|
+
`, this.newLine = `
|
|
1521
|
+
`) : (this.indentate = function() {
|
|
1522
|
+
return "";
|
|
1523
|
+
}, this.tagEndChar = ">", this.newLine = "");
|
|
1524
|
+
}
|
|
1525
|
+
function At(t2, e2, i2, n2) {
|
|
1526
|
+
const s2 = this.extractAttributes(t2);
|
|
1527
|
+
if (n2.push(e2, s2), this.checkStopNode(n2)) {
|
|
1528
|
+
const s3 = this.buildRawContent(t2), r3 = this.buildAttributesForStopNode(t2);
|
|
1529
|
+
return n2.pop(), this.buildObjectNode(s3, e2, r3, i2);
|
|
1530
|
+
}
|
|
1531
|
+
const r2 = this.j2x(t2, i2 + 1, n2);
|
|
1532
|
+
return n2.pop(), t2[this.options.textNodeName] !== undefined && Object.keys(t2).length === 1 ? this.buildTextValNode(t2[this.options.textNodeName], e2, r2.attrStr, i2, n2) : this.buildObjectNode(r2.val, e2, r2.attrStr, i2);
|
|
1533
|
+
}
|
|
1534
|
+
function Ot(t2) {
|
|
1535
|
+
return this.options.indentBy.repeat(t2);
|
|
1536
|
+
}
|
|
1537
|
+
function Ct(t2) {
|
|
1538
|
+
return !(!t2.startsWith(this.options.attributeNamePrefix) || t2 === this.options.textNodeName) && t2.substr(this.attrPrefixLen);
|
|
1539
|
+
}
|
|
1540
|
+
St.prototype.build = function(t2) {
|
|
1541
|
+
if (this.options.preserveOrder)
|
|
1542
|
+
return mt(t2, this.options);
|
|
1543
|
+
{
|
|
1544
|
+
Array.isArray(t2) && this.options.arrayNodeName && this.options.arrayNodeName.length > 1 && (t2 = { [this.options.arrayNodeName]: t2 });
|
|
1545
|
+
const e2 = new G;
|
|
1546
|
+
return this.j2x(t2, 0, e2).val;
|
|
1547
|
+
}
|
|
1548
|
+
}, St.prototype.j2x = function(t2, e2, i2) {
|
|
1549
|
+
let n2 = "", s2 = "";
|
|
1550
|
+
if (this.options.maxNestedTags && i2.getDepth() >= this.options.maxNestedTags)
|
|
1551
|
+
throw new Error("Maximum nested tags exceeded");
|
|
1552
|
+
const r2 = this.options.jPath ? i2.toString() : i2, o2 = this.checkStopNode(i2);
|
|
1553
|
+
for (let a2 in t2)
|
|
1554
|
+
if (Object.prototype.hasOwnProperty.call(t2, a2))
|
|
1555
|
+
if (t2[a2] === undefined)
|
|
1556
|
+
this.isAttribute(a2) && (s2 += "");
|
|
1557
|
+
else if (t2[a2] === null)
|
|
1558
|
+
this.isAttribute(a2) || a2 === this.options.cdataPropName ? s2 += "" : a2[0] === "?" ? s2 += this.indentate(e2) + "<" + a2 + "?" + this.tagEndChar : s2 += this.indentate(e2) + "<" + a2 + "/" + this.tagEndChar;
|
|
1559
|
+
else if (t2[a2] instanceof Date)
|
|
1560
|
+
s2 += this.buildTextValNode(t2[a2], a2, "", e2, i2);
|
|
1561
|
+
else if (typeof t2[a2] != "object") {
|
|
1562
|
+
const h2 = this.isAttribute(a2);
|
|
1563
|
+
if (h2 && !this.ignoreAttributesFn(h2, r2))
|
|
1564
|
+
n2 += this.buildAttrPairStr(h2, "" + t2[a2], o2);
|
|
1565
|
+
else if (!h2)
|
|
1566
|
+
if (a2 === this.options.textNodeName) {
|
|
1567
|
+
let e3 = this.options.tagValueProcessor(a2, "" + t2[a2]);
|
|
1568
|
+
s2 += this.replaceEntitiesValue(e3);
|
|
1569
|
+
} else {
|
|
1570
|
+
i2.push(a2);
|
|
1571
|
+
const n3 = this.checkStopNode(i2);
|
|
1572
|
+
if (i2.pop(), n3) {
|
|
1573
|
+
const i3 = "" + t2[a2];
|
|
1574
|
+
s2 += i3 === "" ? this.indentate(e2) + "<" + a2 + this.closeTag(a2) + this.tagEndChar : this.indentate(e2) + "<" + a2 + ">" + i3 + "</" + a2 + this.tagEndChar;
|
|
1575
|
+
} else
|
|
1576
|
+
s2 += this.buildTextValNode(t2[a2], a2, "", e2, i2);
|
|
1577
|
+
}
|
|
1578
|
+
} else if (Array.isArray(t2[a2])) {
|
|
1579
|
+
const n3 = t2[a2].length;
|
|
1580
|
+
let r3 = "", o3 = "";
|
|
1581
|
+
for (let h2 = 0;h2 < n3; h2++) {
|
|
1582
|
+
const n4 = t2[a2][h2];
|
|
1583
|
+
if (n4 === undefined)
|
|
1584
|
+
;
|
|
1585
|
+
else if (n4 === null)
|
|
1586
|
+
a2[0] === "?" ? s2 += this.indentate(e2) + "<" + a2 + "?" + this.tagEndChar : s2 += this.indentate(e2) + "<" + a2 + "/" + this.tagEndChar;
|
|
1587
|
+
else if (typeof n4 == "object")
|
|
1588
|
+
if (this.options.oneListGroup) {
|
|
1589
|
+
i2.push(a2);
|
|
1590
|
+
const t3 = this.j2x(n4, e2 + 1, i2);
|
|
1591
|
+
i2.pop(), r3 += t3.val, this.options.attributesGroupName && n4.hasOwnProperty(this.options.attributesGroupName) && (o3 += t3.attrStr);
|
|
1592
|
+
} else
|
|
1593
|
+
r3 += this.processTextOrObjNode(n4, a2, e2, i2);
|
|
1594
|
+
else if (this.options.oneListGroup) {
|
|
1595
|
+
let t3 = this.options.tagValueProcessor(a2, n4);
|
|
1596
|
+
t3 = this.replaceEntitiesValue(t3), r3 += t3;
|
|
1597
|
+
} else {
|
|
1598
|
+
i2.push(a2);
|
|
1599
|
+
const t3 = this.checkStopNode(i2);
|
|
1600
|
+
if (i2.pop(), t3) {
|
|
1601
|
+
const t4 = "" + n4;
|
|
1602
|
+
r3 += t4 === "" ? this.indentate(e2) + "<" + a2 + this.closeTag(a2) + this.tagEndChar : this.indentate(e2) + "<" + a2 + ">" + t4 + "</" + a2 + this.tagEndChar;
|
|
1603
|
+
} else
|
|
1604
|
+
r3 += this.buildTextValNode(n4, a2, "", e2, i2);
|
|
1605
|
+
}
|
|
1606
|
+
}
|
|
1607
|
+
this.options.oneListGroup && (r3 = this.buildObjectNode(r3, a2, o3, e2)), s2 += r3;
|
|
1608
|
+
} else if (this.options.attributesGroupName && a2 === this.options.attributesGroupName) {
|
|
1609
|
+
const e3 = Object.keys(t2[a2]), i3 = e3.length;
|
|
1610
|
+
for (let s3 = 0;s3 < i3; s3++)
|
|
1611
|
+
n2 += this.buildAttrPairStr(e3[s3], "" + t2[a2][e3[s3]], o2);
|
|
1612
|
+
} else
|
|
1613
|
+
s2 += this.processTextOrObjNode(t2[a2], a2, e2, i2);
|
|
1614
|
+
return { attrStr: n2, val: s2 };
|
|
1615
|
+
}, St.prototype.buildAttrPairStr = function(t2, e2, i2) {
|
|
1616
|
+
return i2 || (e2 = this.options.attributeValueProcessor(t2, "" + e2), e2 = this.replaceEntitiesValue(e2)), this.options.suppressBooleanAttributes && e2 === "true" ? " " + t2 : " " + t2 + '="' + e2 + '"';
|
|
1617
|
+
}, St.prototype.extractAttributes = function(t2) {
|
|
1618
|
+
if (!t2 || typeof t2 != "object")
|
|
1619
|
+
return null;
|
|
1620
|
+
const e2 = {};
|
|
1621
|
+
let i2 = false;
|
|
1622
|
+
if (this.options.attributesGroupName && t2[this.options.attributesGroupName]) {
|
|
1623
|
+
const n2 = t2[this.options.attributesGroupName];
|
|
1624
|
+
for (let t3 in n2)
|
|
1625
|
+
Object.prototype.hasOwnProperty.call(n2, t3) && (e2[t3.startsWith(this.options.attributeNamePrefix) ? t3.substring(this.options.attributeNamePrefix.length) : t3] = n2[t3], i2 = true);
|
|
1626
|
+
} else
|
|
1627
|
+
for (let n2 in t2) {
|
|
1628
|
+
if (!Object.prototype.hasOwnProperty.call(t2, n2))
|
|
1629
|
+
continue;
|
|
1630
|
+
const s2 = this.isAttribute(n2);
|
|
1631
|
+
s2 && (e2[s2] = t2[n2], i2 = true);
|
|
1632
|
+
}
|
|
1633
|
+
return i2 ? e2 : null;
|
|
1634
|
+
}, St.prototype.buildRawContent = function(t2) {
|
|
1635
|
+
if (typeof t2 == "string")
|
|
1636
|
+
return t2;
|
|
1637
|
+
if (typeof t2 != "object" || t2 === null)
|
|
1638
|
+
return String(t2);
|
|
1639
|
+
if (t2[this.options.textNodeName] !== undefined)
|
|
1640
|
+
return t2[this.options.textNodeName];
|
|
1641
|
+
let e2 = "";
|
|
1642
|
+
for (let i2 in t2) {
|
|
1643
|
+
if (!Object.prototype.hasOwnProperty.call(t2, i2))
|
|
1644
|
+
continue;
|
|
1645
|
+
if (this.isAttribute(i2))
|
|
1646
|
+
continue;
|
|
1647
|
+
if (this.options.attributesGroupName && i2 === this.options.attributesGroupName)
|
|
1648
|
+
continue;
|
|
1649
|
+
const n2 = t2[i2];
|
|
1650
|
+
if (i2 === this.options.textNodeName)
|
|
1651
|
+
e2 += n2;
|
|
1652
|
+
else if (Array.isArray(n2)) {
|
|
1653
|
+
for (let t3 of n2)
|
|
1654
|
+
if (typeof t3 == "string" || typeof t3 == "number")
|
|
1655
|
+
e2 += `<${i2}>${t3}</${i2}>`;
|
|
1656
|
+
else if (typeof t3 == "object" && t3 !== null) {
|
|
1657
|
+
const n3 = this.buildRawContent(t3), s2 = this.buildAttributesForStopNode(t3);
|
|
1658
|
+
e2 += n3 === "" ? `<${i2}${s2}/>` : `<${i2}${s2}>${n3}</${i2}>`;
|
|
1659
|
+
}
|
|
1660
|
+
} else if (typeof n2 == "object" && n2 !== null) {
|
|
1661
|
+
const t3 = this.buildRawContent(n2), s2 = this.buildAttributesForStopNode(n2);
|
|
1662
|
+
e2 += t3 === "" ? `<${i2}${s2}/>` : `<${i2}${s2}>${t3}</${i2}>`;
|
|
1663
|
+
} else
|
|
1664
|
+
e2 += `<${i2}>${n2}</${i2}>`;
|
|
1665
|
+
}
|
|
1666
|
+
return e2;
|
|
1667
|
+
}, St.prototype.buildAttributesForStopNode = function(t2) {
|
|
1668
|
+
if (!t2 || typeof t2 != "object")
|
|
1669
|
+
return "";
|
|
1670
|
+
let e2 = "";
|
|
1671
|
+
if (this.options.attributesGroupName && t2[this.options.attributesGroupName]) {
|
|
1672
|
+
const i2 = t2[this.options.attributesGroupName];
|
|
1673
|
+
for (let t3 in i2) {
|
|
1674
|
+
if (!Object.prototype.hasOwnProperty.call(i2, t3))
|
|
1675
|
+
continue;
|
|
1676
|
+
const n2 = t3.startsWith(this.options.attributeNamePrefix) ? t3.substring(this.options.attributeNamePrefix.length) : t3, s2 = i2[t3];
|
|
1677
|
+
s2 === true && this.options.suppressBooleanAttributes ? e2 += " " + n2 : e2 += " " + n2 + '="' + s2 + '"';
|
|
1678
|
+
}
|
|
1679
|
+
} else
|
|
1680
|
+
for (let i2 in t2) {
|
|
1681
|
+
if (!Object.prototype.hasOwnProperty.call(t2, i2))
|
|
1682
|
+
continue;
|
|
1683
|
+
const n2 = this.isAttribute(i2);
|
|
1684
|
+
if (n2) {
|
|
1685
|
+
const s2 = t2[i2];
|
|
1686
|
+
s2 === true && this.options.suppressBooleanAttributes ? e2 += " " + n2 : e2 += " " + n2 + '="' + s2 + '"';
|
|
1687
|
+
}
|
|
1688
|
+
}
|
|
1689
|
+
return e2;
|
|
1690
|
+
}, St.prototype.buildObjectNode = function(t2, e2, i2, n2) {
|
|
1691
|
+
if (t2 === "")
|
|
1692
|
+
return e2[0] === "?" ? this.indentate(n2) + "<" + e2 + i2 + "?" + this.tagEndChar : this.indentate(n2) + "<" + e2 + i2 + this.closeTag(e2) + this.tagEndChar;
|
|
1693
|
+
{
|
|
1694
|
+
let s2 = "</" + e2 + this.tagEndChar, r2 = "";
|
|
1695
|
+
return e2[0] === "?" && (r2 = "?", s2 = ""), !i2 && i2 !== "" || t2.indexOf("<") !== -1 ? this.options.commentPropName !== false && e2 === this.options.commentPropName && r2.length === 0 ? this.indentate(n2) + `<!--${t2}-->` + this.newLine : this.indentate(n2) + "<" + e2 + i2 + r2 + this.tagEndChar + t2 + this.indentate(n2) + s2 : this.indentate(n2) + "<" + e2 + i2 + r2 + ">" + t2 + s2;
|
|
1696
|
+
}
|
|
1697
|
+
}, St.prototype.closeTag = function(t2) {
|
|
1698
|
+
let e2 = "";
|
|
1699
|
+
return this.options.unpairedTags.indexOf(t2) !== -1 ? this.options.suppressUnpairedNode || (e2 = "/") : e2 = this.options.suppressEmptyNode ? "/" : `></${t2}`, e2;
|
|
1700
|
+
}, St.prototype.checkStopNode = function(t2) {
|
|
1701
|
+
if (!this.stopNodeExpressions || this.stopNodeExpressions.length === 0)
|
|
1702
|
+
return false;
|
|
1703
|
+
for (let e2 = 0;e2 < this.stopNodeExpressions.length; e2++)
|
|
1704
|
+
if (t2.matches(this.stopNodeExpressions[e2]))
|
|
1705
|
+
return true;
|
|
1706
|
+
return false;
|
|
1707
|
+
}, St.prototype.buildTextValNode = function(t2, e2, i2, n2, s2) {
|
|
1708
|
+
if (this.options.cdataPropName !== false && e2 === this.options.cdataPropName)
|
|
1709
|
+
return this.indentate(n2) + `<![CDATA[${t2}]]>` + this.newLine;
|
|
1710
|
+
if (this.options.commentPropName !== false && e2 === this.options.commentPropName)
|
|
1711
|
+
return this.indentate(n2) + `<!--${t2}-->` + this.newLine;
|
|
1712
|
+
if (e2[0] === "?")
|
|
1713
|
+
return this.indentate(n2) + "<" + e2 + i2 + "?" + this.tagEndChar;
|
|
1714
|
+
{
|
|
1715
|
+
let s3 = this.options.tagValueProcessor(e2, t2);
|
|
1716
|
+
return s3 = this.replaceEntitiesValue(s3), s3 === "" ? this.indentate(n2) + "<" + e2 + i2 + this.closeTag(e2) + this.tagEndChar : this.indentate(n2) + "<" + e2 + i2 + ">" + s3 + "</" + e2 + this.tagEndChar;
|
|
1717
|
+
}
|
|
1718
|
+
}, St.prototype.replaceEntitiesValue = function(t2) {
|
|
1719
|
+
if (t2 && t2.length > 0 && this.options.processEntities)
|
|
1720
|
+
for (let e2 = 0;e2 < this.options.entities.length; e2++) {
|
|
1721
|
+
const i2 = this.options.entities[e2];
|
|
1722
|
+
t2 = t2.replace(i2.regex, i2.val);
|
|
1723
|
+
}
|
|
1724
|
+
return t2;
|
|
1725
|
+
};
|
|
1726
|
+
const $t = St, It = { validate: l };
|
|
1727
|
+
module.exports = e;
|
|
1728
|
+
})();
|
|
1729
|
+
});
|
|
1730
|
+
|
|
1731
|
+
export { require_invoke_store, require_dist_cjs, require_dist_cjs2 as require_dist_cjs1, require_fxp };
|