promptfoo 0.121.2 → 0.121.4
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 +2 -0
- package/dist/src/{ListApp-Du7YVwj5.js → ListApp-DQkFNqE9.js} +1 -1
- package/dist/src/{accounts-B0pgC1oV.js → accounts-DdJ2pHMI.js} +5 -5
- package/dist/src/{accounts-CiBLOnA7.js → accounts-DhMYUUbu.js} +5 -5
- package/dist/src/{accounts-gtkH-5KX.cjs → accounts-Dy17bs4D.cjs} +5 -5
- package/dist/src/{accounts-Bm2D8Db9.js → accounts-F9d_5sMC.js} +6 -6
- package/dist/src/{cometapi-C4xSqeID.cjs → agentic-utils-BpX5b23w.cjs} +24 -62
- package/dist/src/{cometapi-CUQq3H_a.js → agentic-utils-P172hM8B.js} +4 -61
- package/dist/src/agentic-utils-qFlm6zes.js +153 -0
- package/dist/src/{agentic-utils-DS1g3GLF.js → agentic-utils-w68v6_Dz.js} +3 -3
- package/dist/src/{agents-CmvBq8LV.js → agents-8FDnTriG.js} +6 -7
- package/dist/src/{agents-DbRtpYxR.cjs → agents-BahDpe5G.cjs} +255 -20
- package/dist/src/{agents-DgF2zDag.js → agents-C-R_jfzI.js} +255 -20
- package/dist/src/{agents-9qiOy0ho.js → agents-CgaMXvLM.js} +5 -7
- package/dist/src/{agents-Di9DKPzn.cjs → agents-D7-HGxUj.cjs} +5 -7
- package/dist/src/{agents-CBr9A01V.js → agents-DJ35I3Nt.js} +255 -20
- package/dist/src/{agents-cLXA8a_8.js → agents-aYPQLf8W.js} +5 -9
- package/dist/src/{agents-D__IdAlg.js → agents-pQeBEXMm.js} +255 -21
- package/dist/src/{aimlapi-B4rcnZgv.js → aimlapi-BCq3MHeL.js} +8 -14
- package/dist/src/{aimlapi-DHJU_kcV.js → aimlapi-BD6J9oKt.js} +7 -14
- package/dist/src/{aimlapi-BvlNH0gr.cjs → aimlapi-qcK4OT55.cjs} +8 -15
- package/dist/src/{aimlapi-CnkC2HqE.js → aimlapi-sgYnkE54.js} +7 -16
- package/dist/src/app/app/tsconfig.app.tsbuildinfo +1 -0
- package/dist/src/app/assets/Report-CQYFezYu.js +1 -0
- package/dist/src/app/assets/index-BXGkeMwh.css +1 -0
- package/dist/src/app/assets/index-BzJt18Jz.js +385 -0
- package/dist/src/app/assets/rolldown-runtime-COnpUsM8.js +1 -0
- package/dist/src/app/assets/scroll-timeline-D9IT_e8Z.js +1 -0
- package/dist/src/app/assets/sync-IjzpWrOE.js +4 -0
- package/dist/src/app/assets/vendor-charts-BNdH8TCw.js +36 -0
- package/dist/src/app/assets/vendor-markdown-Ch00wnNI.js +29 -0
- package/dist/src/app/assets/vendor-react-CVvmk1UB.js +9 -0
- package/dist/src/app/assets/vendor-utils-BnEYbx2Q.js +37 -0
- package/dist/src/app/index.html +7 -7
- package/dist/src/{audio-Dz3z7s3J.js → audio-B7izf48x.js} +4 -5
- package/dist/src/{audio-CGMyULza.cjs → audio-BQtNuYBj.cjs} +4 -4
- package/dist/src/{audio-Bkv46et0.js → audio-COrn8rM6.js} +4 -4
- package/dist/src/{audio-ClI_AFre.js → audio-DcVKoInv.js} +4 -4
- package/dist/src/{base-CGrhspbK.cjs → base-D-670DX8.cjs} +3 -3
- package/dist/src/{base-CpjcHe4e.js → base-PYJvBE1i.js} +3 -3
- package/dist/src/{base-Dy1V8--Z.js → base-fZ9wgg50.js} +3 -3
- package/dist/src/{base-DLKtKMFh.js → base-yrI1Yal4.js} +3 -3
- package/dist/src/{blobs-BDbfYdrJ.js → blobs-BCZavS8s.js} +4 -4
- package/dist/src/{blobs-CMHN0Qcz.js → blobs-BQWqnnvL.js} +4 -4
- package/dist/src/{blobs-CBO20krR.js → blobs-C-F78Kfn.js} +3 -3
- package/dist/src/{blobs-D23XLin-.cjs → blobs-D2FAd1Q5.cjs} +3 -3
- package/dist/src/cache-BIyPcp5v.cjs +376 -0
- package/dist/src/cache-C4Xb-hNb.js +310 -0
- package/dist/src/cache-Cr9oLMUa.js +3 -0
- package/dist/src/cache-D5NZmMiT.js +310 -0
- package/dist/src/cache-DbLsVWB2.cjs +3 -0
- package/dist/src/cache-mb7c8hbp.js +280 -0
- package/dist/src/{chat-C2jrdPMx.js → chat-0bwXjVP0.js} +3 -13
- package/dist/src/{chat-C1Qst7jL.cjs → chat-BPXSW8Bv.cjs} +3 -13
- package/dist/src/{chat-DJIw17u0.js → chat-BfPaS15_.js} +68 -42
- package/dist/src/{chat-CgF-J-Jj.cjs → chat-CclRbxGf.cjs} +68 -42
- package/dist/src/{chat-BiKyneZl.js → chat-Dr3DUQ0D.js} +68 -42
- package/dist/src/{chat-DqxYYtWA.js → chat-I9izLm49.js} +67 -41
- package/dist/src/{chat-CzkrVDfz.js → chat-MKxMnZJZ.js} +3 -13
- package/dist/src/{chat-qmatte1u.js → chat-mW0ORo8G.js} +3 -14
- package/dist/src/{chatkit-DKyPi1Gs.cjs → chatkit-BoWoSgXl.cjs} +4 -4
- package/dist/src/{chatkit-65VXf5SR.js → chatkit-CJnHRRMM.js} +4 -4
- package/dist/src/{chatkit-Be-Q-a9F.js → chatkit-Cv6AhukM.js} +4 -4
- package/dist/src/{chatkit-BxFvW8KY.js → chatkit-zUIVoDos.js} +4 -4
- package/dist/src/{claude-agent-sdk-Apiy0iaz.js → claude-agent-sdk-BQNuLaAK.js} +41 -18
- package/dist/src/{claude-agent-sdk-D9Z5Pr9X.cjs → claude-agent-sdk-CPJo3dBQ.cjs} +45 -22
- package/dist/src/{claude-agent-sdk-D2bJee9S.js → claude-agent-sdk-Dtq_L-Sc.js} +40 -17
- package/dist/src/{claude-agent-sdk-DfCoW0E6.js → claude-agent-sdk-nfAIcxNf.js} +42 -20
- package/dist/src/{cloud-C0dlstV_.js → cloud-DQZ5sVjW.js} +25 -13
- package/dist/src/cloud-Hphvo8kr.js +3 -0
- package/dist/src/{cloudflare-ai-8TDxHR0x.js → cloudflare-ai-BIB567w6.js} +5 -14
- package/dist/src/{cloudflare-ai-g7PB6VHR.js → cloudflare-ai-DGLte7Py.js} +5 -14
- package/dist/src/{cloudflare-ai-CknbZ5LJ.cjs → cloudflare-ai-Dl3N9OVD.cjs} +6 -15
- package/dist/src/{cloudflare-ai-BxAGvfju.js → cloudflare-ai-DlKr0rY7.js} +5 -15
- package/dist/src/{cloudflare-gateway-B9HWA5wf.js → cloudflare-gateway-BDZrYydE.js} +4 -16
- package/dist/src/{cloudflare-gateway-BSnDmHYo.cjs → cloudflare-gateway-BYDp495F.cjs} +4 -15
- package/dist/src/{cloudflare-gateway-CKDb4dJ8.js → cloudflare-gateway-CiIZHU0Q.js} +5 -164
- package/dist/src/{cloudflare-gateway-CP9QEWYS.js → cloudflare-gateway-DI1HNP5F.js} +4 -15
- package/dist/src/codex-sdk-BAmYE7qy.js +3 -0
- package/dist/src/codex-sdk-C2_M2pl_.cjs +1172 -0
- package/dist/src/codex-sdk-CErXn7qh.js +1165 -0
- package/dist/src/codex-sdk-CWEnH70W.cjs +2 -0
- package/dist/src/codex-sdk-CpqiOqDO.js +1164 -0
- package/dist/src/codex-sdk-Rtky3M4I.js +1165 -0
- package/dist/src/{cometapi-BL9yvj_f.js → cometapi-BUlt_ELa.js} +8 -15
- package/dist/src/{cometapi-DFNiKmSz.js → cometapi-CtJ-mS8R.js} +8 -16
- package/dist/src/cometapi-DT-jlVCB.js +55 -0
- package/dist/src/cometapi-UVOryo4W.cjs +55 -0
- package/dist/src/{completion-CM6oK8PS.cjs → completion-BozdoXba.cjs} +7 -62
- package/dist/src/{completion-5MzrpJxT.js → completion-Dnxn7E-j.js} +8 -57
- package/dist/src/{completion-qRoZAYRB.js → completion-HUe8wDhZ.js} +8 -57
- package/dist/src/{completion-DZ083F31.js → completion-x0a_c2y1.js} +8 -57
- package/dist/src/{createHash-CTQmL3G2.js → createHash-4gFQpDDv.js} +3 -3
- package/dist/src/{createHash-CfZSc0b4.cjs → createHash-B7KvgoOD.cjs} +4 -4
- package/dist/src/{createHash-Da8fMwqB.js → createHash-ChI45QR1.js} +3 -3
- package/dist/src/{createHash-DmPQkvBh.js → createHash-CwDVU5xr.js} +3 -3
- package/dist/src/{docker-ExVyLp0S.js → docker-CQmlA2NU.js} +7 -14
- package/dist/src/{docker-Bb5dcxr8.js → docker-ClnmCf1Z.js} +6 -14
- package/dist/src/{docker-BvfL2BrW.js → docker-DCgsveLD.js} +6 -16
- package/dist/src/{docker-DcF2pRrj.cjs → docker-DS4_Osau.cjs} +7 -15
- package/dist/src/embedding-D3xTseo7.js +59 -0
- package/dist/src/embedding-DD9wa3ae.js +58 -0
- package/dist/src/embedding-I45KG3o7.cjs +63 -0
- package/dist/src/embedding-nFbumxcv.js +58 -0
- package/dist/src/entrypoint.js +69 -6
- package/dist/src/{errors-P6ll7XSJ.js → errors-Cw810C93.js} +1 -1
- package/dist/src/{esm-CaIwzWR5.js → esm-C7PnfdF8.js} +16 -7
- package/dist/src/{esm-CnNt7sI4.cjs → esm-CtEPLdAj.cjs} +15 -6
- package/dist/src/{esm-Cd1AjG1D.js → esm-Dh4dOLlt.js} +15 -6
- package/dist/src/{esm-C03C-mv3.js → esm-tVgYPY-f.js} +27 -18
- package/dist/src/eval-CzJFfFO9.js +3 -0
- package/dist/src/{eval-Dg2nG4v2.js → eval-u4UVafl6.js} +49 -20
- package/dist/src/{evalResult-BDMqrapS.js → evalResult-Bgm9ZH31.js} +7 -7
- package/dist/src/{evalResult-BBRNtX4I.js → evalResult-D3hVYFis.js} +7 -7
- package/dist/src/evalResult-D8MT9p0s.js +3 -0
- package/dist/src/evalResult-DElBuddX.js +2 -0
- package/dist/src/evalResult-Dvc-iucu.cjs +2 -0
- package/dist/src/{evalResult-fuaI8HkH.cjs → evalResult-KZqXl4XP.cjs} +7 -7
- package/dist/src/evaluator-CVessDWe.js +3 -0
- package/dist/src/{evaluator-BhoWwp5b.js → evaluator-IvuDYSvQ.js} +3080 -1254
- package/dist/src/{extractor-D25qpmGX.js → extractor-CAfTSraf.js} +6 -6
- package/dist/src/{extractor-DReVID0K.js → extractor-DNSeBVOJ.js} +6 -6
- package/dist/src/{extractor-C0EVHewb.js → extractor-Dk6bRWkv.js} +6 -6
- package/dist/src/{extractor-pYLLi3wS.cjs → extractor-WVPOrH43.cjs} +6 -6
- package/dist/src/{fetch-HaqdX7U1.js → fetch-B0Z3Oe4k.js} +218 -55
- package/dist/src/{fetch-Dxpd4_sr.js → fetch-BEWnXrrG.js} +195 -45
- package/dist/src/fetch-C7bGKDlQ.js +3 -0
- package/dist/src/{fetch-BPkYtG8K.cjs → fetch-CJU5ELPa.cjs} +223 -48
- package/dist/src/{fetch-Cwxnd8zz.js → fetch-Di00EQrc.js} +218 -55
- package/dist/src/{fileExtensions-Ds-foDzt.js → fileExtensions-AWa2ZML4.js} +1 -1
- package/dist/src/{fileExtensions-LcDYkU4v.js → fileExtensions-BArZuxsI.js} +1 -1
- package/dist/src/{formatDuration-DgBVMN65.js → formatDuration-DZzPsexs.js} +1 -1
- package/dist/src/{genaiTracer-D3fD9dNV.js → genaiTracer-COYDi-tC.js} +6 -2
- package/dist/src/{genaiTracer-C1rxGO8Q.js → genaiTracer-DWdZ28hY.js} +6 -2
- package/dist/src/{genaiTracer-70Z8BIuV.js → genaiTracer-XnrcgDCe.js} +6 -2
- package/dist/src/{genaiTracer-DN4dQywX.cjs → genaiTracer-yRuxj9-L.cjs} +7 -3
- package/dist/src/golang/wrapper.go +1 -1
- package/dist/src/{graders-DU49_J8Y.cjs → graders--zknU_uk.cjs} +5747 -3206
- package/dist/src/graders-BOAzQEUe.cjs +2 -0
- package/dist/src/graders-D4BTsZdG2.js +3 -0
- package/dist/src/graders-DOJK1XpV.js +2 -0
- package/dist/src/graders-NAv9LcBn.js +2 -0
- package/dist/src/{graders-BTeBGqjJ.js → graders-Zy3x0zqX.js} +5727 -3218
- package/dist/src/{graders-Bj_Odv7c.js → graders-eIHhRqoC.js} +5719 -3210
- package/dist/src/{graders-DP7KFFo-.js → graders-pvbReLLn.js} +5728 -3219
- package/dist/src/{image-B0h9VEMc.js → image-9302QVqR.js} +4 -4
- package/dist/src/{image-CHfWvljl.js → image-B5Mv-Z3h.js} +8 -8
- package/dist/src/{image-DS-o-0ph.js → image-DVz2RiMF.js} +8 -8
- package/dist/src/{image-C1madmKh.cjs → image-De2FBmYV.cjs} +4 -4
- package/dist/src/{image-B02ogr_b.js → image-dnoUgPrC.js} +4 -5
- package/dist/src/{image-Dpxa1Jt6.js → image-qUpPvmNZ.js} +8 -8
- package/dist/src/{image-Bb4vWQLM.js → image-u7-rKnYU.js} +4 -4
- package/dist/src/{image-BLmROtN3.cjs → image-x6KqLQl4.cjs} +8 -8
- package/dist/src/index.cjs +3728 -1482
- package/dist/src/index.d.cts +3232 -79
- package/dist/src/index.d.ts +3232 -79
- package/dist/src/index.js +3735 -1490
- package/dist/src/{interactiveCheck-BgLZUIt3.js → interactiveCheck-CLERUB0c.js} +2 -2
- package/dist/src/{knowledgeBase-DOO_BM9b.cjs → knowledgeBase-Bpoe_nLu.cjs} +6 -8
- package/dist/src/{knowledgeBase-D33Ty2l6.js → knowledgeBase-Dgc7CBWF.js} +6 -8
- package/dist/src/{knowledgeBase-B3OoKIej.js → knowledgeBase-RhFPGWDc.js} +6 -8
- package/dist/src/{knowledgeBase-CYTLHOt1.js → knowledgeBase-lm9RXSAm.js} +6 -9
- package/dist/src/{litellm-NbjknEh6.js → litellm-C2kqjxqp.js} +6 -14
- package/dist/src/{litellm-I_hbp_dc.cjs → litellm-CoyI4IAl.cjs} +6 -15
- package/dist/src/{litellm-TrljxD9G.js → litellm-DRjpcSa7.js} +5 -14
- package/dist/src/{litellm-AaeZcZQF.js → litellm-p37R1dzQ.js} +5 -16
- package/dist/src/{logger-DLcq4dWf.js → logger-B88EkIn6.js} +48 -23
- package/dist/src/{logger-Cp1GPUjj.cjs → logger-COuQb2xB.cjs} +77 -22
- package/dist/src/{logger-CT3IKMKA.js → logger-Ct2S6Yx-.js} +48 -23
- package/dist/src/{logger-KkObSCzq.js → logger-DksKw1Qc.js} +48 -23
- package/dist/src/{luma-ray-f6I2fft-.js → luma-ray-B863CmuZ.js} +6 -10
- package/dist/src/{luma-ray-DDsjcgZZ.js → luma-ray-BTTLtqQ8.js} +7 -10
- package/dist/src/{luma-ray-Due0n7di.cjs → luma-ray-BxVKaW2a.cjs} +6 -10
- package/dist/src/{luma-ray-BS2_tY8L.js → luma-ray-KgTCXrZC.js} +6 -12
- package/dist/src/main.d.ts +1 -26
- package/dist/src/main.js +1011 -548
- package/dist/src/{messages-Bs1kC7P4.cjs → messages-811uVVW5.cjs} +74 -19
- package/dist/src/{messages-BS17jdMx.js → messages-BTQz42fn.js} +74 -19
- package/dist/src/{messages-ZJk778GH.js → messages-MYTQ2TWp.js} +74 -19
- package/dist/src/{messages-D0lx5qK7.js → messages-zWbkLLHz.js} +74 -19
- package/dist/src/{meteor-D-SotUw9.js → meteor-CU5UAE-H.js} +1 -1
- package/dist/src/{meteor-DLZZ3osF.cjs → meteor-Co1VQ1u5.cjs} +1 -1
- package/dist/src/{meteor-44VjEACX.js → meteor-DHdzY1Ss.js} +1 -1
- package/dist/src/{meteor-DUiCJRC-.js → meteor-DuAFv6gF.js} +1 -1
- package/dist/src/{modelslab-Bmni6skY.js → modelslab-D0erNWKe.js} +7 -10
- package/dist/src/{modelslab-DRb74SP4.js → modelslab-DIq-6y7x.js} +7 -10
- package/dist/src/{modelslab-CoUX6Jc_.cjs → modelslab-Dk1JAtVo.cjs} +7 -10
- package/dist/src/{modelslab-Bx9IrZfS.js → modelslab-wu9yi5GE.js} +7 -11
- package/dist/src/{nova-reel-BfPq-0Yk.js → nova-reel-CCFRfeRb.js} +7 -10
- package/dist/src/{nova-reel-C_QM18Xn.cjs → nova-reel-CrLXVKQf.cjs} +6 -10
- package/dist/src/{nova-reel-bgjxilYW.js → nova-reel-DQrm74ng.js} +6 -10
- package/dist/src/{nova-reel-D_W1tjMH.js → nova-reel-gr11WG7f.js} +6 -12
- package/dist/src/{nova-sonic-DIGQNR07.js → nova-sonic-BYdp-QLs.js} +5 -7
- package/dist/src/{nova-sonic-CFb5GYhg.js → nova-sonic-B_ZXcUJB.js} +4 -7
- package/dist/src/{nova-sonic-De1HW5fD.js → nova-sonic-TDgrlTk7.js} +4 -9
- package/dist/src/{nova-sonic-zfcljeRp.cjs → nova-sonic-i5tUvXKn.cjs} +4 -7
- package/dist/src/{openai-DElQ-fPX.js → openai-DhVEmgeZ.js} +6 -3
- package/dist/src/{openai-DhbB7eWK.js → openai-Qsvz25mV.js} +6 -3
- package/dist/src/{openai-Cuif0GEt.cjs → openai-URNyItar.cjs} +6 -3
- package/dist/src/{openai-j-sE2O7r.js → openai-iYtrXzOX.js} +6 -3
- package/dist/src/openclaw-CLWrW03k.js +1200 -0
- package/dist/src/openclaw-CnQ363Wi.js +1199 -0
- package/dist/src/openclaw-CwzlQSQX.js +1199 -0
- package/dist/src/openclaw-wX9rtfke.cjs +1205 -0
- package/dist/src/{opencode-sdk-B3CWY9h_.js → opencode-sdk-BUu5Nevv.js} +12 -14
- package/dist/src/{opencode-sdk-BL764Jdi.cjs → opencode-sdk-BZ2idgYA.cjs} +16 -18
- package/dist/src/{opencode-sdk-0j6rTWNb.js → opencode-sdk-BxD8vXp_.js} +12 -15
- package/dist/src/{opencode-sdk-C2y6UkP2.js → opencode-sdk-GI2KaAXq.js} +12 -14
- package/dist/src/{otlpReceiver-C99PPb48.js → otlpReceiver-B2z58l4e.js} +154 -98
- package/dist/src/{otlpReceiver-CGq6LspY.cjs → otlpReceiver-BfcVq2Nq.cjs} +154 -98
- package/dist/src/{otlpReceiver-D89fR-rC.js → otlpReceiver-BntK801g.js} +154 -98
- package/dist/src/{otlpReceiver-CdNBdbsk.js → otlpReceiver-DmVulbhC.js} +154 -98
- package/dist/src/{providerRegistry-CD8MEar9.js → providerRegistry-Bvh8mv85.js} +2 -2
- package/dist/src/{providerRegistry-DM8rZYol.js → providerRegistry-CPQ_CmVO.js} +2 -2
- package/dist/src/{providerRegistry-Civky8Ar.cjs → providerRegistry-CQMdTmHP.cjs} +2 -2
- package/dist/src/{providerRegistry-B0RUOLI_.js → providerRegistry-CWoPjKFZ.js} +2 -2
- package/dist/src/{providers-CgKOSgTR.cjs → providers-1eKkXBKp.cjs} +1435 -930
- package/dist/src/{providers-BlqUifFg.js → providers-BV_KMZje.js} +1419 -944
- package/dist/src/providers-Bp4S-FvO.js +2 -0
- package/dist/src/providers-DV3ax9e_.cjs +3 -0
- package/dist/src/{providers-D8lF1sqW.js → providers-Domz_llv.js} +1427 -952
- package/dist/src/{providers-Dk_6ocUX.js → providers-DruaQfwu.js} +1424 -949
- package/dist/src/providers-iUt5fbAN.js +3 -0
- package/dist/src/providers-u9Enmfok.js +2 -0
- package/dist/src/python/persistent_wrapper.py +0 -5
- package/dist/src/{pythonUtils-D6fwaDSg.js → pythonUtils-C2UQ30Rz.js} +4 -4
- package/dist/src/{pythonUtils-D5nxkQ0P.js → pythonUtils-Cldx7huE.js} +4 -4
- package/dist/src/{pythonUtils-C3py6GC1.js → pythonUtils-CnndUbW-.js} +3 -3
- package/dist/src/{pythonUtils-CTU3Y3lw.cjs → pythonUtils-tAJvvpS-.cjs} +3 -3
- package/dist/src/{quiverai-CIaELU_m.js → quiverai-CtWi6x_g.js} +4 -4
- package/dist/src/{quiverai-PdShCPox.cjs → quiverai-DFotyafY.cjs} +4 -4
- package/dist/src/{quiverai-BbOUOn2L.js → quiverai-DR0SnIQV.js} +4 -4
- package/dist/src/{quiverai-uH-dcTIr.js → quiverai-aPPvXOgn.js} +4 -5
- package/dist/src/render-CH-62LbA.js +135 -0
- package/dist/src/render-CMEpfLaO.js +136 -0
- package/dist/src/{render-Drod8m7K.js → render-CgVDrJmM.js} +2 -3
- package/dist/src/render-DHIZ6_k8.js +135 -0
- package/dist/src/render-DfQSFxGE.cjs +165 -0
- package/dist/src/{responses-DIR9Ud3j.js → responses--OsX2aYW.js} +23 -14
- package/dist/src/{responses-D8SBTL64.cjs → responses-Bi9vBuW_.cjs} +24 -15
- package/dist/src/{responses-CB2jwoAr.js → responses-C-flexAY.js} +24 -15
- package/dist/src/{responses-WNGNYe3K.js → responses-DL9m8CyY.js} +24 -15
- package/dist/src/{rubyUtils-DhCAlxZr.cjs → rubyUtils-B6eljPuh.cjs} +3 -3
- package/dist/src/{rubyUtils-BcuGX77l.js → rubyUtils-CYSQEG4a.js} +3 -3
- package/dist/src/rubyUtils-D1L2d3jb.js +3 -0
- package/dist/src/rubyUtils-DUbq4tff.cjs +2 -0
- package/dist/src/{rubyUtils-BUVePouc.js → rubyUtils-DVLeA2jg.js} +3 -3
- package/dist/src/{rubyUtils-Boc4HZzX.js → rubyUtils-DsGrTx8R.js} +3 -3
- package/dist/src/{sagemaker-CNBxx5CJ.js → sagemaker-BVkaG2-l.js} +14 -18
- package/dist/src/{sagemaker-CemTFp2h.js → sagemaker-BveBvuxm.js} +14 -18
- package/dist/src/{sagemaker-YSyBXQQh.js → sagemaker-D67yzMzs.js} +14 -19
- package/dist/src/{sagemaker-Cl28mZU2.cjs → sagemaker-XnfhheQv.cjs} +14 -18
- package/dist/src/{scanner-BsBlNXNn.js → scanner-1DqWi1Ej.js} +130 -35
- package/dist/src/server/golang/wrapper.go +1 -1
- package/dist/src/server/index.js +3757 -1511
- package/dist/src/server/python/persistent_wrapper.py +0 -5
- package/dist/src/{server-CqzrVGpF.js → server-BNYztJkh.js} +128 -9
- package/dist/src/{server-CuxBbeSY.js → server-BSB45Nt9.js} +127 -8
- package/dist/src/{server-VWgWb00X.js → server-D6Il2Sob.js} +126 -7
- package/dist/src/server-DCtHUqlp.js +3 -0
- package/dist/src/server-DaA2eR26.cjs +2 -0
- package/dist/src/{server-C_7Ax-hA.cjs → server-Dx2TyCH2.cjs} +140 -6
- package/dist/src/{signal-4U3mfRvL.js → signal-CE5G3a7x.js} +3 -3
- package/dist/src/{slack-BmVAVGaK.cjs → slack-1Rhq0EoV.cjs} +2 -2
- package/dist/src/{slack-DCUPTzS2.js → slack-D5Wpy8LM.js} +2 -2
- package/dist/src/{slack-DXMKtA-f.js → slack-DDUe-5MC.js} +2 -2
- package/dist/src/{slack-DOdy_kyv.js → slack-acRb0IqQ.js} +2 -2
- package/dist/src/store-CWOSz6D_.cjs +2 -0
- package/dist/src/{store-Dim__MDd.js → store-CYEy5J2D.js} +17 -5
- package/dist/src/{store-DLlFCC4h.cjs → store-DAAyxcy6.cjs} +17 -5
- package/dist/src/store-DCDBhv7B.js +3 -0
- package/dist/src/{store-CXGFv4aR.js → store-Dn9HUkdW.js} +17 -5
- package/dist/src/{store-DXilxTl-.js → store-M0b1WfYb.js} +17 -5
- package/dist/src/{tables-gftXzE9I.js → tables-C4CH3zRr.js} +3 -3
- package/dist/src/{tables-DLJPUdUE.js → tables-CsWou1Bx.js} +3 -3
- package/dist/src/{tables-6YKwjN9-.js → tables-DQ4WU5tX.js} +3 -3
- package/dist/src/{tables-DPi7wKeM.cjs → tables-DUfh1F7Z.cjs} +3 -3
- package/dist/src/telemetry-C1IqxcdW.js +3 -0
- package/dist/src/telemetry-C4ZEa_es.cjs +2 -0
- package/dist/src/{telemetry-CMrFgtPB.js → telemetry-CQPez_Jp.js} +4 -4
- package/dist/src/{telemetry-DaX14Chu.cjs → telemetry-Dsw_faFj.cjs} +4 -4
- package/dist/src/{telemetry-Dthj_BbD.js → telemetry-Dvqxv3YC.js} +4 -4
- package/dist/src/{telemetry-Cps3mIU-.js → telemetry-dbaJ0E98.js} +4 -4
- package/dist/src/{text-CW1cyrwj.cjs → text-BVi-cLPJ.cjs} +1 -1
- package/dist/src/{text-B_UCRPp2.js → text-CZr46tp_.js} +1 -1
- package/dist/src/{text-TIv0QYnd.js → text-DHxdyQqT.js} +1 -1
- package/dist/src/{text-Db-Wt2u2.js → text-KvuD2Iko.js} +1 -1
- package/dist/src/{tokenUsageUtils-bVa1ga6f.cjs → tokenUsageUtils-Bb7DkZPz.cjs} +7 -3
- package/dist/src/{tokenUsageUtils-NYT-WKS6.js → tokenUsageUtils-C-bmyHoE.js} +7 -3
- package/dist/src/{tokenUsageUtils-DflFMjS0.js → tokenUsageUtils-CXrvO-wA.js} +7 -3
- package/dist/src/{transcription-NLVG9MT1.cjs → transcription-BvjmiYB1.cjs} +12 -16
- package/dist/src/{transcription-BNYURcXg.js → transcription-CJspiD2c.js} +11 -14
- package/dist/src/{transcription-B_OdaHp7.js → transcription-DuWDupG7.js} +10 -14
- package/dist/src/{transcription-s6A-bNrZ.js → transcription-V2HaAmy2.js} +10 -16
- package/dist/src/{transform-DECvGmzp.js → transform-Bbg6A8Jk.js} +4 -4
- package/dist/src/{transform-vNucnNr0.js → transform-CG0ehZNG.js} +11 -7
- package/dist/src/{transform-DuHvhZpj.cjs → transform-CTeuTR3S.cjs} +31 -9
- package/dist/src/{transform-CzK1Q0zl.cjs → transform-CUnzlsbn.cjs} +4 -4
- package/dist/src/{transform-aa6tmVpZ.js → transform-DYX1_Xnh.js} +5 -5
- package/dist/src/transform-DgKlRr73.cjs +2 -0
- package/dist/src/transform-M6ITAESf.js +3 -0
- package/dist/src/{transform-DilY9wbS.js → transform-UN5UGu8U.js} +5 -5
- package/dist/src/{transform-uAytVuyX.js → transform-lQrDE1BQ.js} +11 -7
- package/dist/src/{transform-D5HsjduX.js → transform-zDhMmzwX.js} +11 -7
- package/dist/src/{transformersAvailability-CEVM2GNQ.js → transformersAvailability-CcHusyhw.js} +1 -1
- package/dist/src/{transformersAvailability-CwayUSlh.cjs → transformersAvailability-Cju9mHgR.cjs} +1 -1
- package/dist/src/{transformersAvailability-D6c6ROpT.js → transformersAvailability-DLlROWhg.js} +1 -1
- package/dist/src/{types-DmyIJ-sR.js → types-BGQDAP8i.js} +357 -22
- package/dist/src/{types-CzW2QFyi.js → types-Bgh5SOn6.js} +358 -24
- package/dist/src/{types-C_7nyzr1.cjs → types-CeaeaZdP.cjs} +393 -22
- package/dist/src/{types-Cbd8uOMq.js → types-Dm9JM6Vb.js} +368 -23
- package/dist/src/{util-BHGHw5G1.js → util-BYvQUPp7.js} +138 -36
- package/dist/src/{util-B9vlHIIh.cjs → util-Bxn8emtE.cjs} +15 -168
- package/dist/src/{util-ZzmqNPlg.js → util-C8e5uydV.js} +19 -142
- package/dist/src/{util-CMy69ZgQ.js → util-C9J8ahRn.js} +18 -4
- package/dist/src/{util-BzMcevZc.cjs → util-CN3SrLT4.cjs} +18 -4
- package/dist/src/{util-BV4XUC0n.js → util-D3q0WQ-0.js} +18 -4
- package/dist/src/{util-Dnmk2mBQ.js → util-D9TisOyk.js} +18 -4
- package/dist/src/{util-B3xGByQh.js → util-DDs-7g6-.js} +138 -36
- package/dist/src/{util-Bv6uGDfH.js → util-DvU2Pw8c.js} +138 -36
- package/dist/src/{util-C1CeHl-P.js → util-DxWpWjhc.js} +13 -136
- package/dist/src/{util-BRYkYPTd.js → util-oGMLA7vc.js} +17 -140
- package/dist/src/{util-DGNOS1db.cjs → util-olYL5C6N.cjs} +143 -35
- package/dist/src/{utils-Cz9qXqII.cjs → utils-B05gLxER.cjs} +6 -4
- package/dist/src/{utils-f2-Moju7.js → utils-BLJKfv0y.js} +6 -4
- package/dist/src/{utils-dLokC-eR.js → utils-DJfvjyMj.js} +6 -4
- package/dist/src/{utils-XiOAgly5.js → utils-hXtCYanr.js} +6 -4
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +66 -57
- package/dist/src/app/assets/index-4LKxG2CG.js +0 -439
- package/dist/src/app/assets/index-C3zcsZFQ.css +0 -1
- package/dist/src/app/assets/scroll-timeline-BdJZVXlz.js +0 -1
- package/dist/src/app/assets/sync-9qqYcY-B.js +0 -4
- package/dist/src/app/assets/vendor-charts-BnDWwBlI.js +0 -36
- package/dist/src/app/assets/vendor-markdown-0tekx3KX.js +0 -29
- package/dist/src/app/assets/vendor-react-AtKqiNEf.js +0 -4
- package/dist/src/app/assets/vendor-syntax-D06x6TQF.js +0 -2
- package/dist/src/app/assets/vendor-utils-BvMHZmO7.js +0 -37
- package/dist/src/app/tsconfig.app.tsbuildinfo +0 -1
- package/dist/src/cache-BVeDlD87.js +0 -726
- package/dist/src/cache-C4Nxf52C.js +0 -756
- package/dist/src/cache-CeUpFm3M.cjs +0 -5
- package/dist/src/cache-Dh5WtQps.cjs +0 -816
- package/dist/src/cache-i1P6crbO.js +0 -756
- package/dist/src/cache-n-RCJ-hL.js +0 -6
- package/dist/src/cloud-BBh91EUK.js +0 -4
- package/dist/src/codex-sdk-C6UMlxwV.js +0 -665
- package/dist/src/codex-sdk-DUwKWezN.js +0 -665
- package/dist/src/codex-sdk-GGAw0qbD.js +0 -666
- package/dist/src/codex-sdk-fAO0c3yA.cjs +0 -669
- package/dist/src/eval-B3r2CVXr.js +0 -15
- package/dist/src/evalResult-5xwYnECe.js +0 -12
- package/dist/src/evalResult-71lY93Kj.cjs +0 -10
- package/dist/src/evalResult-Dx5P5cIv.js +0 -10
- package/dist/src/evaluator-Jx6bRZV6.js +0 -36
- package/dist/src/fetch-BxNb_Lp3.js +0 -5
- package/dist/src/graders-B_pgMLS2.js +0 -34
- package/dist/src/graders-DErokPDO.cjs +0 -32
- package/dist/src/graders-DR_uNe54.js +0 -32
- package/dist/src/graders-w3176Wz-.js +0 -32
- package/dist/src/openclaw-CSugPYAr.cjs +0 -586
- package/dist/src/openclaw-DiSz3I5L.js +0 -582
- package/dist/src/openclaw-DuvJKEW5.js +0 -580
- package/dist/src/openclaw-tiVYRtr-.js +0 -580
- package/dist/src/providers-B7V0njNs.js +0 -32
- package/dist/src/providers-BEwbhv0X.js +0 -30
- package/dist/src/providers-CH3C7zf7.js +0 -30
- package/dist/src/providers-zyB6k_38.cjs +0 -31
- package/dist/src/rubyUtils-BUHu6PhO.js +0 -5
- package/dist/src/rubyUtils-CP42kMvq.cjs +0 -4
- package/dist/src/server-DA4Cyrrq.js +0 -7
- package/dist/src/server-Dulb-4-K.cjs +0 -5
- package/dist/src/store-CXS-Q_91.js +0 -6
- package/dist/src/store-eYkaKMwq.cjs +0 -5
- package/dist/src/telemetry-BpMfhthR.cjs +0 -5
- package/dist/src/telemetry-Dw38hanS.js +0 -7
- package/dist/src/tokenUsageUtils-BDGe-iyI.js +0 -138
- package/dist/src/transform-DTGDnAzW.js +0 -6
- package/dist/src/transform-m3qNw4KP.cjs +0 -5
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var un=Object.defineProperty,mn=(p,k,A)=>k in p?un(p,k,{enumerable:!0,configurable:!0,writable:!0,value:A}):p[k]=A,v=(p,k,A)=>(mn(p,typeof k!="symbol"?k+"":k,A),A);(function(){class p{}class k extends p{constructor(t){super(),v(this,"value"),this.value=t}}class A extends p{constructor(t){super(),v(this,"value"),this.value=t}}class It extends p{constructor(t){super(),v(this,"value"),this.value=t}}class Pt extends p{constructor(t,n="unrestricted"){super(),v(this,"type"),v(this,"value"),this.value=t,this.type=n}}class Rt extends p{constructor(t){super(),v(this,"value"),this.value=t}}class At extends p{}class Nt extends p{constructor(t){super(),v(this,"value"),this.value=t}}class Se extends p{}class P extends p{constructor(t){super(),v(this,"value"),this.value=t}}class Q extends p{constructor(t,n="integer"){super(),v(this,"value"),v(this,"type"),this.value=t,this.type=n}}class ie extends p{constructor(t){super(),v(this,"value"),this.value=t}}class X extends p{constructor(t,n,i){super(),v(this,"value"),v(this,"type"),v(this,"unit"),this.value=t,this.type=n,this.unit=i}}class Y extends p{}class Vt extends p{}class Lt extends p{}class Ot extends p{}class Ut extends p{}class Ke extends p{}class ve extends p{}class Be extends p{}class N extends p{}class J extends p{}class Te extends p{}class Ge extends p{}class _t{constructor(t){v(this,"input"),v(this,"index",0),this.input=t}consume(){const t=this.input.codePointAt(this.index);return t!==void 0&&(this.index+=String.fromCodePoint(t).length),t}reconsume(t){t!==void 0&&(this.index-=String.fromCodePoint(t).length)}peek(){const t=[];let n=this.index;for(let i=0;i<3&&n<this.input.length;i++){const r=this.input.codePointAt(n);t.push(r),n+=String.fromCodePoint(r).length}return t}}function ye(e){return e===10}function V(e){return ye(e)||e===8192||e===32}function M(e){return e>=48&&e<=57}function Qe(e){return M(e)||e>=65&&e<=70||e>=97&&e<=102}function re(e){return(function(t){return(function(n){return n>=65&&n<=90})(t)||(function(n){return n>=97&&n<=122})(t)})(e)||(function(t){return t>=128})(e)||e===95}function Xe(e){return re(e)||M(e)||e===45}function jt(e){return e>=0&&e<=8||e===11||e>=14&&e<=31||e===127}function D(e,t){return e===92&&!ye(t)}function se(e,t,n){return e===45?re(t)||t===45||D(t,n):!!re(e)||e===92&&D(e,t)}function we(e,t,n){return e===43||e===45?M(t)||t===46&&M(n):M(e===46?t:e)}function oe(e){const t=e.consume();if(Qe(t)){const n=[t];for(;Qe(...e.peek())&&n.length<5;)n.push(e.consume());V(...e.peek())&&e.consume();const i=parseInt(String.fromCodePoint(...n),16);return i===0||i>1114111?65533:i}return t===void 0?65533:t}function Ye(e,t){const n=new Rt("");for(;;){const i=e.consume();if(i===t||i===void 0)return n;if(i===10)return e.reconsume(i),new At;if(i===92){const r=e.peek()[0];r===void 0||(ye(r)?e.consume():n.value+=String.fromCodePoint(oe(e)))}else n.value+=String.fromCodePoint(i)}}function ae(e){let t="";for(;;){const n=e.consume();if(Xe(n))t+=String.fromCodePoint(n);else{if(!D(...e.peek()))return e.reconsume(n),t;t+=String.fromCodePoint(oe(e))}}}function le(e){const t=(function(n){let i="integer",r="";for([43,45].includes(n.peek()[0])&&(r+=String.fromCodePoint(n.consume()));M(...n.peek());)r+=String.fromCodePoint(n.consume());if(n.peek()[0]===46&&M(n.peek()[1]))for(r+=String.fromCodePoint(n.consume(),n.consume()),i="number";M(...n.peek());)r+=String.fromCodePoint(n.consume());return[69,101].includes(n.peek()[0])&&([45,43].includes(n.peek()[1])&&M(n.peek()[2])?(r+=String.fromCodePoint(n.consume(),n.consume(),n.consume()),i="number"):M(n.peek()[1])&&(r+=String.fromCodePoint(n.consume(),n.consume()),i="number")),{value:parseFloat(r),type:i}})(e);return se(...e.peek())?new X(t.value,t.type,ae(e)):e.peek()[0]===37?(e.consume(),new ie(t.value)):new Q(t.value,t.type)}function xe(e){for(;;){const t=e.consume();if(t===41||t===void 0)return;D(...e.peek())&&oe(e)}}function be(e){const t=ae(e);if(t.match(/url/i)&&e.peek()[0]===40){for(e.consume();V(e.peek()[0])&&V(e.peek()[1]);)e.consume();return[34,39].includes(e.peek()[0])||V(e.peek()[0])&&[34,39].includes(e.peek()[1])?new A(t):(function(n){const i=new Nt("");for(;V(...n.peek());)n.consume();for(;;){const r=n.consume();if(r===41||r===void 0)return i;if(V(r)){for(;V(...n.peek());)n.consume();return n.peek()[0]===41||n.peek()[0]===void 0?(n.consume(),i):(xe(n),new Se)}if([34,39,40].includes(r)||jt(r))return xe(n),new Se;if(r===92){if(!D(...n.peek()))return xe(n),new Se;i.value+=oe(n)}else i.value+=String.fromCodePoint(r)}})(e)}return e.peek()[0]===40?(e.consume(),new A(t)):new k(t)}function Wt(e){const t=e.consume(),n=e.peek();if(V(t)){for(;V(...e.peek());)e.consume();return new Y}if(t===34)return Ye(e,t);if(t===35){if(Xe(n[0])||D(...n)){const i=new Pt;return se(...n)&&(i.type="id"),i.value=ae(e),i}return new P(String.fromCodePoint(t))}return t===39?Ye(e,t):t===40?new N:t===41?new J:t===43?we(...n)?(e.reconsume(t),le(e)):new P(String.fromCodePoint(t)):t===44?new Ke:t===45?we(...e.peek())?(e.reconsume(t),le(e)):e.peek()[0]===45&&e.peek()[1]===62?(e.consume(),e.consume(),new Lt):se(...e.peek())?(e.reconsume(t),be(e)):new P(String.fromCodePoint(t)):t===46?we(...e.peek())?(e.reconsume(t),le(e)):new P(String.fromCodePoint(t)):t===58?new Ot:t===59?new Ut:t===60?n[0]===33&&n[1]===45&&n[2]===45?(e.consume(),e.consume(),e.consume(),new Vt):new P(String.fromCodePoint(t)):t===64?se(...n)?new It(ae(e)):new P(String.fromCodePoint(t)):t===91?new ve:t===92?D(...n)?(e.reconsume(t),be(e)):new P(String.fromCodePoint(t)):t===93?new Be:t===123?new Te:t===125?new Ge:M(t)?(e.reconsume(t),le(e)):re(t)?(e.reconsume(t),be(e)):t===void 0?void 0:new P(String.fromCodePoint(t))}const Dt=new Set(["px","deg","s","hz","dppx","number","fr"]);function Ee(e){return Dt.has(e.toLowerCase())}function Ce(e,t){if(["x","y"].includes(e))return e;if(!t)throw new Error("To determine the normalized axis the computedStyle of the source is required.");const n=t.writingMode=="horizontal-tb";if(e==="block")e=n?"y":"x";else{if(e!=="inline")throw new TypeError(`Invalid axis “${e}”`);e=n?"x":"y"}return e}function ke(e){const t=[];let n=0;function i(){let s=0;const o=n;for(;n<e.length;){const l=e.slice(n,n+1);if(/\s/.test(l)&&s===0)break;if(l==="(")s+=1;else if(l===")"&&(s-=1,s===0)){n++;break}n++}return e.slice(o,n)}function r(){for(;/\s/.test(e.slice(n,n+1));)n++}for(;n<e.length;){const s=e.slice(n,n+1);/\s/.test(s)?r():t.push(i())}return t}function Je(e,t){return e.reduce((n,i)=>(n.has(i[t])?n.get(i[t]).push(i):n.set(i[t],[i]),n),new Map)}function Ze(e,t){const n=[],i=[];for(const r of e)t(r)?n.push(r):i.push(r);return[n,i]}function E(e,t={}){function n(i){return Array.from(i).map(r=>E(r,t))}if(e instanceof CSSUnitValue){if(e.unit==="percent"&&t.percentageReference){const r=e.value/100*t.percentageReference.value,s=t.percentageReference.unit;return new CSSUnitValue(r,s)}const i=e.toSum();if(i&&i.values.length===1&&(e=i.values[0]),e instanceof CSSUnitValue&&e.unit==="em"&&t.fontSize&&(e=new CSSUnitValue(e.value*t.fontSize.value,t.fontSize.unit)),e instanceof CSSKeywordValue){if(e.value==="e")return new CSSUnitValue(Math.E,"number");if(e.value==="pi")return new CSSUnitValue(Math.PI,"number")}return e}if(!e.operator)return e;switch(e.operator){case"sum":e=new CSSMathSum(...n(e.values));break;case"product":e=new CSSMathProduct(...n(e.values));break;case"negate":e=new CSSMathNegate(E(e.value,t));break;case"clamp":e=new CSSMathClamp(E(e.lower,t),E(e.value,t),E(e.upper,t));break;case"invert":e=new CSSMathInvert(E(e.value,t));break;case"min":e=new CSSMathMin(...n(e.values));break;case"max":e=new CSSMathMax(...n(e.values))}if(e instanceof CSSMathMin||e instanceof CSSMathMax){const i=Array.from(e.values);if(i.every(r=>r instanceof CSSUnitValue&&r.unit!=="percent"&&Ee(r.unit)&&r.unit===i[0].unit)){const r=Math[e.operator].apply(Math,i.map(({value:s})=>s));return new CSSUnitValue(r,i[0].unit)}}if(e instanceof CSSMathMin||e instanceof CSSMathMax){const i=Array.from(e.values),[r,s]=Ze(i,l=>l instanceof CSSUnitValue&&l.unit!=="percent"),o=Array.from(Je(r,"unit").values());if(o.some(l=>l.length>0)){const l=o.map(a=>{const c=Math[e.operator].apply(Math,a.map(({value:u})=>u));return new CSSUnitValue(c,a[0].unit)});e=e instanceof CSSMathMin?new CSSMathMin(...l,...s):new CSSMathMax(...l,...s)}return i.length===1?i[0]:e}if(e instanceof CSSMathNegate)return e.value instanceof CSSUnitValue?new CSSUnitValue(0-e.value.value,e.value.unit):e.value instanceof CSSMathNegate?e.value.value:e;if(e instanceof CSSMathInvert)return e.value instanceof CSSMathInvert?e.value.value:e;if(e instanceof CSSMathSum){let i=function(s){const o=s.filter(l=>l instanceof CSSUnitValue);return[...s.filter(l=>!(l instanceof CSSUnitValue)),...Array.from(Je(o,"unit").entries()).map(([l,a])=>{const c=a.reduce((u,{value:f})=>u+f,0);return new CSSUnitValue(c,l)})]},r=[];for(const s of e.values)s instanceof CSSMathSum?r.push(...s.values):r.push(s);return r=i(r),r.length===1?r[0]:new CSSMathSum(...r)}if(e instanceof CSSMathProduct){let i=[];for(const o of e.values)o instanceof CSSMathProduct?i.push(...o.values):i.push(o);const[r,s]=Ze(i,o=>o instanceof CSSUnitValue&&o.unit==="number");if(r.length>1){const o=r.reduce((l,{value:a})=>l*a,1);i=[new CSSUnitValue(o,"number"),...s]}if(i.length===2){let o,l;for(const a of i)a instanceof CSSUnitValue&&a.unit==="number"?o=a:a instanceof CSSMathSum&&[...a.values].every(c=>c instanceof CSSUnitValue)&&(l=a);if(o&&l)return new CSSMathSum(...[...l.values].map(a=>new CSSUnitValue(a.value*o.value,a.unit)))}if(i.every(o=>o instanceof CSSUnitValue&&Ee(o.unit)||o instanceof CSSMathInvert&&o.value instanceof CSSUnitValue&&Ee(o.value.unit))){const o=new CSSMathProduct(...i).toSum();if(o&&o.values.length===1)return o.values[0]}return new CSSMathProduct(...i)}return e}const b=null,et=["percent","length","angle","time","frequency","resolution","flex"],j={fontRelativeLengths:{units:new Set(["em","rem","ex","rex","cap","rcap","ch","rch","ic","ric","lh","rlh"])},viewportRelativeLengths:{units:new Set(["vw","lvw","svw","dvw","vh","lvh","svh","dvh","vi","lvi","svi","dvi","vb","lvb","svb","dvb","vmin","lvmin","svmin","dvmin","vmax","lvmax","svmax","dvmax"])},absoluteLengths:{units:new Set(["cm","mm","Q","in","pt","pc","px"]),compatible:!0,canonicalUnit:"px",ratios:{cm:96/2.54,mm:96/2.54/10,Q:96/2.54/40,in:96,pc:16,pt:96/72,px:1}},angle:{units:new Set(["deg","grad","rad","turn"]),compatible:!0,canonicalUnit:"deg",ratios:{deg:1,grad:.9,rad:180/Math.PI,turn:360}},time:{units:new Set(["s","ms"]),compatible:!0,canonicalUnit:"s",ratios:{s:1,ms:.001}},frequency:{units:new Set(["hz","khz"]),compatible:!0,canonicalUnit:"hz",ratios:{hz:1,khz:1e3}},resolution:{units:new Set(["dpi","dpcm","dppx"]),compatible:!0,canonicalUnit:"dppx",ratios:{dpi:1/96,dpcm:2.54/96,dppx:1}}},tt=new Map;for(const e of Object.values(j))if(e.compatible)for(const t of e.units)tt.set(t,e);function Me(e){return tt.get(e)}function zt(e,t){const n={...e};for(const i of Object.keys(t))n[i]?n[i]+=t[i]:n[i]=t[i];return n}function Ie(e){return e==="number"?{}:e==="percent"?{percent:1}:j.absoluteLengths.units.has(e)||j.fontRelativeLengths.units.has(e)||j.viewportRelativeLengths.units.has(e)?{length:1}:j.angle.units.has(e)?{angle:1}:j.time.units.has(e)?{time:1}:j.frequency.units.has(e)?{frequency:1}:j.resolution.units.has(e)?{resolution:1}:e==="fr"?{flex:1}:b}function ce(e){if(e instanceof CSSUnitValue){let{unit:t,value:n}=e;const i=Me(e.unit);return i&&t!==i.canonicalUnit&&(n*=i.ratios[t],t=i.canonicalUnit),t==="number"?[[n,{}]]:[[n,{[t]:1}]]}if(e instanceof CSSMathInvert){if(!(e.value instanceof CSSUnitValue))throw new Error("Not implemented");const t=ce(e.value);if(t===b||t.length>1)return b;const n=t[0],i={};for(const[r,s]of Object.entries(n[1]))i[r]=-1*s;return t[0]=[1/n[0],i],t}if(e instanceof CSSMathProduct){let t=[[1,{}]];for(const n of e.values){const i=ce(n),r=[];if(i===b)return b;for(const s of t)for(const o of i)r.push([s[0]*o[0],zt(s[1],o[1])]);t=r}return t}throw new Error("Not implemented")}function Ht(e,t){if(Ie(t)===b)throw new SyntaxError("The string did not match the expected pattern.");const n=ce(e);if(!n)throw new TypeError;if(n.length>1)throw new TypeError("Sum has more than one item");const i=(function(r,s){const o=r.unit,l=r.value,a=Me(o),c=Me(s);return!c||a!==c?b:new CSSUnitValue(l*c.ratios[o]/c.ratios[s],s)})(nt(n[0]),t);if(i===b)throw new TypeError;return i}function nt(e){const[t,n]=e,i=Object.entries(n);if(i.length>1)return b;if(i.length===0)return new CSSUnitValue(t,"number");const r=i[0];return r[1]!==1?b:new CSSUnitValue(t,r[0])}function it(e,...t){if(t&&t.length)throw new Error("Not implemented");const n=ce(e).map(i=>nt(i));if(n.some(i=>i===b))throw new TypeError("Type error");return new CSSMathSum(...n)}function $t(e,t){if(e.percentHint&&t.percentHint&&e.percentHint!==t.percentHint)return b;const n={...e,percentHint:e.percentHint??t.percentHint};for(const i of et)t[i]&&(n[i]??(n[i]=0),n[i]+=t[i]);return n}class ${constructor(t,n){v(this,"name"),v(this,"values"),this.name=t,this.values=n}}class Pe{constructor(t,n){v(this,"value"),v(this,"associatedToken"),this.value=t,this.associatedToken=n}}function Ft(e){if(Array.isArray(e))return e;if(typeof e=="string")return(function(t){const n=new _t(t),i=[];for(;;){const r=Wt(n);if(r===void 0)return i;i.push(r)}})(e);throw new TypeError("Invalid input type "+typeof e)}function Re(e){const t=e.shift();return t instanceof Te||t instanceof ve||t instanceof N?(function(n,i){let r;if(i instanceof Te)r=Ge;else if(i instanceof N)r=J;else{if(!(i instanceof ve))return;r=Be}const s=new Pe([],i);for(;;){const o=n.shift();if(o instanceof r||o===void 0)return s;n.unshift(o),s.value.push(Re(n))}})(e,t):t instanceof A?(function(n,i){const r=new $(n.value,[]);for(;;){const s=i.shift();if(s instanceof J||s===void 0)return r;i.unshift(s),r.values.push(Re(i))}})(t,e):t}function rt(e){if(e instanceof N||e instanceof J)return 6;if(e instanceof P)switch(e.value){case"*":case"/":return 4;case"+":case"-":return 2}}function Z(e){return e[e.length-1]}function Ae(e,t,n){const i=["+","-"].includes(e.value)?"ADDITION":"MULTIPLICATION",r=t.type===i?t.values:[t],s=n.type===i?n.values:[n];return e.value==="-"?s[0]={type:"NEGATE",value:s[0]}:e.value==="/"&&(s[0]={type:"INVERT",value:s[0]}),{type:i,values:[...r,...s]}}function ee(e){if(e.type==="ADDITION")return new CSSMathSum(...e.values.map(t=>ee(t)));if(e.type==="MULTIPLICATION")return new CSSMathProduct(...e.values.map(t=>ee(t)));if(e.type==="NEGATE")return new CSSMathNegate(ee(e.value));if(e.type==="INVERT")return new CSSMathInvert(ee(e.value));if(e instanceof Pe)return Ne(new $("calc",e.value));if(e instanceof k){if(e.value==="e")return new CSSUnitValue(Math.E,"number");if(e.value==="pi")return new CSSUnitValue(Math.PI,"number");throw new SyntaxError("Invalid math expression")}return st(e)}function Ne(e){if(e.name==="min"||e.name==="max"){const i=e.values.filter(r=>!(r instanceof Y||r instanceof Ke)).map(r=>E(Ne(new $("calc",r))));return e.name==="min"?new CSSMathMin(...i):new CSSMathMax(...i)}if(e.name!=="calc")return null;const t=ee((function(i){const r=[],s=[];for(;i.length;){const o=i.shift();if(o instanceof Q||o instanceof X||o instanceof ie||o instanceof $||o instanceof Pe||o instanceof k)s.push(o);else if(o instanceof P&&["*","/","+","-"].includes(o.value)){for(;r.length&&!(Z(r)instanceof N)&&rt(Z(r))>rt(o);){const l=r.pop(),a=s.pop(),c=s.pop();s.push(Ae(l,c,a))}r.push(o)}else if(o instanceof N)r.push(o);else if(o instanceof J){if(!r.length)return null;for(;!(Z(r)instanceof N);){const l=r.pop(),a=s.pop(),c=s.pop();s.push(Ae(l,c,a))}if(!(Z(r)instanceof N))return null;r.pop()}else if(!(o instanceof Y))return null}for(;r.length;){if(Z(r)instanceof N)return null;const o=r.pop(),l=s.pop(),a=s.pop();s.push(Ae(o,a,l))}return s[0]})([...e.values]));let n;try{n=E(t)}catch{new CSSStyleSheet().insertRule("error",0)}return n instanceof CSSUnitValue?new CSSMathSum(n):n}function st(e){return e instanceof $&&["calc","min","max","clamp"].includes(e.name)?Ne(e):e instanceof Q&&e.value===0&&!e.unit?new CSSUnitValue(0,"px"):e instanceof Q?new CSSUnitValue(e.value,"number"):e instanceof ie?new CSSUnitValue(e.value,"percent"):e instanceof X?new CSSUnitValue(e.value,e.unit):void 0}function qt(e){const t=(function(n){const i=Ft(n);for(;i[0]instanceof Y;)i.shift();if(i[0]===void 0)return null;const r=Re(i);for(;i[0]instanceof Y;)i.shift();return i[0]===void 0?r:null})(e);return t===null&&new CSSStyleSheet().insertRule("error",0),t instanceof Q||t instanceof ie||t instanceof X||t instanceof $||new CSSStyleSheet().insertRule("error",0),t instanceof X&&Ie(t.unit)===null&&new CSSStyleSheet().insertRule("error",0),st(t)}(function(){const e=new WeakMap;function t(s){const o=[];for(let a=0;a<s.length;a++)o[a]=typeof(l=s[a])=="number"?new CSSUnitValue(l,"number"):l;var l;return o}class n{static parse(o){return o instanceof n?o:E(qt(o),{})}}class i extends n{constructor(o,l,a,c){super(),e.set(this,{values:t(o),operator:l,name:a||l,delimiter:c||", "})}get operator(){return e.get(this).operator}get values(){return e.get(this).values}toString(){const o=e.get(this);return`${o.name}(${o.values.join(o.delimiter)})`}}const r={CSSNumericValue:n,CSSMathValue:i,CSSUnitValue:class extends n{constructor(s,o){super(),e.set(this,{value:s,unit:o})}get value(){return e.get(this).value}set value(s){e.get(this).value=s}get unit(){return e.get(this).unit}to(s){return Ht(this,s)}toSum(...s){return it(this,...s)}type(){return Ie(e.get(this).unit)}toString(){const s=e.get(this);return`${s.value}${(function(o){switch(o){case"percent":return"%";case"number":return"";default:return o.toLowerCase()}})(s.unit)}`}},CSSKeywordValue:class{constructor(s){this.value=s}toString(){return this.value.toString()}},CSSMathSum:class extends i{constructor(s){super(arguments,"sum","calc"," + ")}},CSSMathProduct:class extends i{constructor(s){super(arguments,"product","calc"," * ")}toSum(...s){return it(this,...s)}type(){return e.get(this).values.map(s=>s.type()).reduce($t)}},CSSMathNegate:class extends i{constructor(s){super([arguments[0]],"negate","-")}get value(){return e.get(this).values[0]}type(){return this.value.type()}},CSSMathInvert:class extends i{constructor(s){super([1,arguments[0]],"invert","calc"," / ")}get value(){return e.get(this).values[1]}type(){return(function(s){const o={};for(const l of et)o[l]=-1*s[l];return o})(e.get(this).values[1].type())}},CSSMathMax:class extends i{constructor(){super(arguments,"max")}},CSSMathMin:class extends i{constructor(){super(arguments,"min")}}};if(!window.CSS&&!Reflect.defineProperty(window,"CSS",{value:{}}))throw Error("Error installing CSSOM support");window.CSSUnitValue||["number","percent","em","ex","px","cm","mm","in","pt","pc","Q","vw","vh","vmin","vmax","rems","ch","deg","rad","grad","turn","ms","s","Hz","kHz","dppx","dpi","dpcm","fr"].forEach(s=>{if(!Reflect.defineProperty(CSS,s,{value:o=>new CSSUnitValue(o,s)}))throw Error(`Error installing CSS.${s}`)});for(const[s,o]of Object.entries(r))if(!(s in window)&&!Reflect.defineProperty(window,s,{value:o}))throw Error(`Error installing CSSOM support for ${s}`)})();const ot="block",y=new WeakMap,L=new WeakMap,ue=["entry","exit","cover","contain","entry-crossing","exit-crossing"];function at(e){return e===document.scrollingElement?document:e}function z(e){Le(e);const t=y.get(e).animations;if(t.length===0)return;const n=e.currentTime;for(let i=0;i<t.length;i++)t[i].tickAnimation(n)}function lt(e,t){if(!e)return null;const n=L.get(e).sourceMeasurements,i=getComputedStyle(e);let r=n.scrollTop;return Ce(t,i)==="x"&&(r=Math.abs(n.scrollLeft)),r}function Ve(e,t){const n=E(e,t);if(n instanceof CSSUnitValue){if(n.unit==="px")return n.value;throw TypeError("Unhandled unit type "+n.unit)}throw TypeError("Unsupported value type: "+typeof e)}function Le(e){if(!(e instanceof q))return void(function(n){const i=y.get(n);if(!i.anonymousSource)return;const r=ut(i.anonymousSource,i.anonymousTarget);F(n,r)})(e);const t=e.subject;if(!t||getComputedStyle(t).display=="none")return void F(e,null);F(e,De(t))}function ct(e){return["block","inline","x","y"].includes(e)}function Oe(e){const t=getComputedStyle(e);return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop,scrollWidth:e.scrollWidth,scrollHeight:e.scrollHeight,clientWidth:e.clientWidth,clientHeight:e.clientHeight,writingMode:t.writingMode,direction:t.direction,scrollPaddingTop:t.scrollPaddingTop,scrollPaddingBottom:t.scrollPaddingBottom,scrollPaddingLeft:t.scrollPaddingLeft,scrollPaddingRight:t.scrollPaddingRight}}function Ue(e,t){if(!e||!t)return;let n=0,i=0,r=t;const s=e.offsetParent;for(;r&&r!=s;)i+=r.offsetLeft,n+=r.offsetTop,r=r.offsetParent;i-=e.offsetLeft+e.clientLeft,n-=e.offsetTop+e.clientTop;const o=getComputedStyle(t);return{top:n,left:i,offsetWidth:t.offsetWidth,offsetHeight:t.offsetHeight,fontSize:o.fontSize}}function me(e){const t=L.get(e);t.sourceMeasurements=Oe(e);for(const n of t.timelineRefs){const i=n.deref();i instanceof q&&(y.get(i).subjectMeasurements=Ue(e,i.subject))}t.updateScheduled||(setTimeout(()=>{for(const n of t.timelineRefs){const i=n.deref();i&&z(i)}t.updateScheduled=!1}),t.updateScheduled=!0)}function F(e,t){const n=y.get(e),i=n.source;if(i!=t){if(i){const r=L.get(i);if(r){r.timelineRefs.delete(e);const s=Array.from(r.timelineRefs).filter(o=>o.deref()===void 0);for(const o of s)r.timelineRefs.delete(o);r.timelineRefs.size===0&&(r.disconnect(),L.delete(i))}}if(n.source=t,t){let r=L.get(t);if(!r){r={timelineRefs:new Set,sourceMeasurements:Oe(t)},L.set(t,r);const s=new ResizeObserver(a=>{for(const c of a)me(n.source)});s.observe(t);for(const a of t.children)s.observe(a);const o=new MutationObserver(a=>{for(const c of a)me(c.target)});o.observe(t,{attributes:!0,attributeFilter:["style","class"]});const l=()=>{r.sourceMeasurements.scrollLeft=t.scrollLeft,r.sourceMeasurements.scrollTop=t.scrollTop;for(const a of r.timelineRefs){const c=a.deref();c&&z(c)}};at(t).addEventListener("scroll",l),r.disconnect=()=>{s.disconnect(),o.disconnect(),at(t).removeEventListener("scroll",l)}}r.timelineRefs.add(new WeakRef(e))}}}function _e(e,t){const n=y.get(e).animations;for(let i=0;i<n.length;i++)n[i].animation==t&&n.splice(i,1)}function je(e,t,n){const i=y.get(e).animations;for(let r=0;r<i.length;r++)if(i[r].animation==t)return;i.push({animation:t,tickAnimation:n}),queueMicrotask(()=>{z(e)})}class w{constructor(t){if(y.set(this,{source:null,axis:ot,anonymousSource:t?t.anonymousSource:null,anonymousTarget:t?t.anonymousTarget:null,subject:null,inset:null,animations:[],subjectMeasurements:null}),F(this,t&&t.source!==void 0?t.source:document.scrollingElement),t&&t.axis!==void 0&&t.axis!=ot){if(!ct(t.axis))throw TypeError("Invalid axis");y.get(this).axis=t.axis}z(this)}set source(t){F(this,t),z(this)}get source(){return y.get(this).source}set axis(t){if(!ct(t))throw TypeError("Invalid axis");y.get(this).axis=t,z(this)}get axis(){return y.get(this).axis}get duration(){return CSS.percent(100)}get phase(){const t=this.source;if(!t)return"inactive";const n=getComputedStyle(t);return n.display=="none"?"inactive":t==document.scrollingElement||n.overflow!="visible"&&n.overflow!="clip"?"active":"inactive"}get currentTime(){const n=this.source;if(!n||!n.isConnected||this.phase=="inactive")return null;const i=getComputedStyle(n);if(i.display==="inline"||i.display==="none")return null;const r=this.axis,s=lt(n,r),o=(function(l,a){const c=L.get(l).sourceMeasurements,u=getComputedStyle(l).writingMode=="horizontal-tb";return a==="block"?a=u?"y":"x":a==="inline"&&(a=u?"x":"y"),a==="y"?c.scrollHeight-c.clientHeight:a==="x"?c.scrollWidth-c.clientWidth:void 0})(n,r);return o>0?CSS.percent(100*s/o):CSS.percent(100)}get __polyfill(){return!0}}function We(e,t){let n=e.parentElement;for(;n!=null;){if(t(n))return n;n=n.parentElement}}function ut(e,t){switch(e){case"root":return document.scrollingElement;case"nearest":return De(t);case"self":return t;default:throw new TypeError("Invalid ScrollTimeline Source Type.")}}function Kt(e){switch(getComputedStyle(e).display){case"block":case"inline-block":case"list-item":case"table":case"table-caption":case"flow-root":case"flex":case"grid":return!0}return!1}function mt(e){const t=getComputedStyle(e);return t.transform!="none"||t.perspective!="none"||t.willChange=="transform"||t.willChange=="perspective"||t.filter!="none"||t.willChange=="filter"||t.backdropFilter!="none"}function Bt(e){return getComputedStyle(e).position!="static"||mt(e)}function Gt(e){switch(getComputedStyle(e).position){case"static":case"relative":case"sticky":return We(e,Kt);case"absolute":return We(e,Bt);case"fixed":return We(e,mt)}}function De(e){if(e&&e.isConnected){for(;e=Gt(e);)switch(getComputedStyle(e)["overflow-x"]){case"auto":case"scroll":case"hidden":return e==document.body&&getComputedStyle(document.scrollingElement).overflow=="visible"?document.scrollingElement:e}return document.scrollingElement}}function te(e,t){const n=y.get(e),i=n.subjectMeasurements,r=L.get(n.source).sourceMeasurements;return e.phase==="inactive"?null:e instanceof q?ze(t,r,i,n.axis,n.inset):null}function ze(e,t,n,i,r){const s=t.direction=="rtl"||t.writingMode=="vertical-rl";let o,l,a={fontSize:n.fontSize};Ce(i,t)==="x"?(o=n.offsetWidth,l=n.left,a.scrollPadding=[t.scrollPaddingLeft,t.scrollPaddingRight],s&&(l+=t.scrollWidth-t.clientWidth,a.scrollPadding=[t.scrollPaddingRight,t.scrollPaddingLeft]),a.containerSize=t.clientWidth):(o=n.offsetHeight,l=n.top,a.scrollPadding=[t.scrollPaddingTop,t.scrollPaddingBottom],a.containerSize=t.clientHeight);const c=(function(qe,ge){const an={start:0,end:0};if(!qe)return an;const[ln,cn]=[qe.start,qe.end].map((kt,Mt)=>kt==="auto"?ge.scrollPadding[Mt]==="auto"?0:parseFloat(ge.scrollPadding[Mt]):Ve(kt,{percentageReference:CSS.px(ge.containerSize),fontSize:CSS.px(parseFloat(ge.fontSize))}));return{start:ln,end:cn}})(r,a),u=l-a.containerSize+c.end,f=l+o-c.start,h=u+o,d=f-o,S=Math.min(h,d),x=Math.max(h,d);let I,C;const Ct=o>a.containerSize-c.start-c.end;switch(e){case"cover":I=u,C=f;break;case"contain":I=S,C=x;break;case"entry":I=u,C=S;break;case"exit":I=x,C=f;break;case"entry-crossing":I=u,C=Ct?x:S;break;case"exit-crossing":I=Ct?S:x,C=f}return{start:I,end:C}}function ft(e,t){if(e instanceof q){const{rangeName:n,offset:i}=t;return ht(te(e,n),i,te(e,"cover"),e.subject)}if(e instanceof w){const{axis:n,source:i}=e,{sourceMeasurements:r}=L.get(i);let s;return s=Ce(n,r)==="x"?r.scrollWidth-r.clientWidth:r.scrollHeight-r.clientHeight,Ve(t,{percentageReference:CSS.px(s)})/s}unsupportedTimeline(e)}function ht(e,t,n,i){if(!e||!n)return 0;const r=getComputedStyle(i);return(Ve(t,{percentageReference:CSS.px(e.end-e.start),fontSize:CSS.px(parseFloat(r.fontSize))})+e.start-n.start)/(n.end-n.start)}const q=class extends w{constructor(t){super(t);const n=y.get(this);n.subject=t&&t.subject?t.subject:void 0,t&&t.inset&&(n.inset=(function(i){if(!i)return{start:0,end:0};let r;if(r=typeof i=="string"?ke(i).map(s=>{if(s==="auto")return"auto";try{return CSSNumericValue.parse(s)}catch{throw TypeError(`Could not parse inset "${i}"`)}}):Array.isArray(i)?i:[i],r.length===0||r.length>2)throw TypeError("Invalid inset");for(const s of r){if(s==="auto")continue;const o=s.type();if(o.length!==1&&o.percent!==1)throw TypeError("Invalid inset")}return{start:r[0],end:r[1]??r[0]}})(t.inset)),n.subject&&(new ResizeObserver(()=>{me(n.source)}).observe(n.subject),new MutationObserver(()=>{me(n.source)}).observe(n.subject,{attributes:!0,attributeFilter:["class","style"]})),Le(this),n.subjectMeasurements=Ue(n.source,n.subject),z(this)}get source(){return Le(this),y.get(this).source}set source(t){throw new Error("Cannot set the source of a view timeline")}get subject(){return y.get(this).subject}get axis(){return y.get(this).axis}get currentTime(){const n=lt(this.source,this.axis);if(n==null)return null;const i=te(this,"cover");if(!i)return null;const r=(n-i.start)/(i.end-i.start);return CSS.percent(100*r)}get startOffset(){return CSS.px(te(this,"cover").start)}get endOffset(){return CSS.px(te(this,"cover").end)}},Qt=document.getAnimations,Xt=window.Element.prototype.getAnimations,Yt=window.Element.prototype.animate,pt=window.Animation;class K{constructor(){this.state="pending",this.nativeResolve=this.nativeReject=null,this.promise=new Promise((t,n)=>{this.nativeResolve=t,this.nativeReject=n})}resolve(t){this.state="resolved",this.nativeResolve(t)}reject(t){this.state="rejected",this.promise.catch(()=>{}),this.nativeReject(t)}}function ne(e){e.readyPromise=new K,requestAnimationFrame(()=>{var t;(((t=e.timeline)==null?void 0:t.currentTime)??null)!==null&&(fe(e),e.pendingTask!=="play"||e.startTime===null&&e.holdTime===null?e.pendingTask==="pause"&&St(e):gt(e))})}function dt(){return new DOMException("The user aborted a request","AbortError")}function H(e,t){if(t===null)return t;if(typeof t!="number")throw new DOMException(`Unexpected value: ${t}. Cannot convert to CssNumberish`,"InvalidStateError");const n=e.rangeDuration??100,i=U(e),r=i?n*t/i:0;return CSS.percent(r)}function g(e,t){if(e.timeline){if(t===null)return t;if(t.unit==="percent"){const n=e.rangeDuration??100,i=U(e);return t.value*i/n}throw new DOMException("CSSNumericValue must be a percentage for progress based animations.","NotSupportedError")}{if(t==null||typeof t=="number")return t;const n=t.to("ms");if(n)return n.value;throw new DOMException("CSSNumericValue must be either a number or a time value for time based animations.","InvalidStateError")}}function gt(e){const t=g(e,e.timeline.currentTime);if(e.holdTime!=null)R(e),e.animation.playbackRate==0?e.startTime=t:(e.startTime=t-e.holdTime/e.animation.playbackRate,e.holdTime=null);else if(e.startTime!==null&&e.pendingPlaybackRate!==null){const n=(t-e.startTime)*e.animation.playbackRate;R(e);const i=e.animation.playbackRate;i==0?(e.holdTime=null,e.startTime=t):e.startTime=t-n/i}e.readyPromise&&e.readyPromise.state=="pending"&&e.readyPromise.resolve(e.proxy),O(e,!1,!1),_(e),e.pendingTask=null}function St(e){const t=g(e,e.timeline.currentTime);e.startTime!=null&&e.holdTime==null&&(e.holdTime=(t-e.startTime)*e.animation.playbackRate),R(e),e.startTime=null,e.readyPromise.resolve(e.proxy),O(e,!1,!1),_(e),e.pendingTask=null}function vt(e){if(!e.finishedPromise||e.finishedPromise.state!="pending"||e.proxy.playState!="finished")return;e.finishedPromise.resolve(e.proxy),e.animation.pause();const t=new CustomEvent("finish",{detail:{currentTime:e.proxy.currentTime,timelineTime:e.proxy.timeline.currentTime}});Object.defineProperty(t,"currentTime",{get:function(){return this.detail.currentTime}}),Object.defineProperty(t,"timelineTime",{get:function(){return this.detail.timelineTime}}),requestAnimationFrame(()=>{queueMicrotask(()=>{e.animation.dispatchEvent(t)})})}function B(e){return e.pendingPlaybackRate!==null?e.pendingPlaybackRate:e.animation.playbackRate}function R(e){e.pendingPlaybackRate!==null&&(e.animation.playbackRate=e.pendingPlaybackRate,e.pendingPlaybackRate=null)}function Tt(e){if(!e.timeline)return null;const t=g(e,e.timeline.currentTime);if(t===null||e.startTime===null)return null;let n=(t-e.startTime)*e.animation.playbackRate;return n==-0&&(n=0),n}function O(e,t,n){if(!e.timeline)return;const i=t?g(e,e.proxy.currentTime):Tt(e);if(i&&e.startTime!=null&&!e.proxy.pending){const r=B(e),s=U(e);let o=e.previousCurrentTime;r>0&&i>=s&&e.previousCurrentTime!=null?((o===null||o<s)&&(o=s),e.holdTime=t?i:o):r<0&&i<=0?((o==null||o>0)&&(o=0),e.holdTime=t?i:o):r!=0&&(t&&e.holdTime!==null&&(e.startTime=(function(l,a){if(!l.timeline)return null;const c=g(l,l.timeline.currentTime);return c==null?null:c-a/l.animation.playbackRate})(e,e.holdTime)),e.holdTime=null)}_(e),e.previousCurrentTime=g(e,e.proxy.currentTime),e.proxy.playState=="finished"?(e.finishedPromise||(e.finishedPromise=new K),e.finishedPromise.state=="pending"&&(n?vt(e):Promise.resolve().then(()=>{vt(e)}))):(e.finishedPromise&&e.finishedPromise.state=="resolved"&&(e.finishedPromise=new K),e.animation.playState!="paused"&&e.animation.pause())}function U(e){const t=(function(i){const r=i.proxy.effect.getTiming();return i.normalizedTiming||r})(e),n=t.delay+t.endDelay+t.iterations*t.duration;return Math.max(0,n)}function _(e){if(e.timeline)if(e.startTime!==null){const t=e.timeline.currentTime;if(t==null)return;He(e,(g(e,t)-e.startTime)*e.animation.playbackRate)}else e.holdTime!==null&&He(e,e.holdTime)}function He(e,t){const n=e.timeline,i=e.animation.playbackRate,r=n.currentTime&&n.currentTime.value==(i<0?0:100)?i<0?.001:-.001:0;e.animation.currentTime=t+r}function $e(e,t){if(!e.timeline)return;const n=e.proxy.playState=="paused"&&e.proxy.pending;let i=!1,r=g(e,e.proxy.currentTime);B(e)==0&&r==null&&(e.holdTime=0),r==null&&(e.autoAlignStartTime=!0),(e.proxy.playState==="finished"||n)&&(e.holdTime=null,e.startTime=null,e.autoAlignStartTime=!0),e.holdTime&&(e.startTime=null),e.pendingTask&&(e.pendingTask=null,i=!0),(e.holdTime!==null||e.autoAlignStartTime||n||e.pendingPlaybackRate!==null)&&(e.readyPromise&&!i&&(e.readyPromise=null),_(e),e.readyPromise||ne(e),e.pendingTask="play",je(e.timeline,e.animation,Fe.bind(e.proxy)),O(e,!1,!1))}function Fe(e){const t=m.get(this);if(!t)return;if(e==null)return void(t.proxy.playState!=="paused"&&t.animation.playState!="idle"&&t.animation.cancel());fe(t),t.pendingTask&&requestAnimationFrame(()=>{t.pendingTask!=="play"||t.startTime===null&&t.holdTime===null?t.pendingTask==="pause"&&St(t):gt(t)});const n=this.playState;if(n=="running"||n=="finished"){const i=g(t,e);He(t,(i-g(t,this.startTime))*this.playbackRate),O(t,!1,!1)}}function yt(e){e.specifiedTiming=null}let m=new WeakMap;window.addEventListener("pagehide",e=>{m=new WeakMap},!1);const wt=new WeakMap;function fe(e){if(!e.autoAlignStartTime||!e.timeline||!e.timeline.currentTime||e.proxy.playState==="idle"||e.proxy.playState==="paused"&&e.holdTime!==null)return;const t=e.rangeDuration;let n,i;try{n=CSS.percent(100*(function(s){if(!s.animationRange)return 0;const o=s.animationRange.start==="normal"?xt(s.timeline):s.animationRange.start;return ft(s.timeline,o)})(e))}catch(s){n=CSS.percent(0),e.animationRange.start="normal",console.warn("Exception when calculating start offset",s)}try{i=CSS.percent(100*(1-(function(s){if(!s.animationRange)return 0;const o=s.animationRange.end==="normal"?bt(s.timeline):s.animationRange.end;return 1-ft(s.timeline,o)})(e)))}catch(s){i=CSS.percent(100),e.animationRange.end="normal",console.warn("Exception when calculating end offset",s)}e.rangeDuration=i.value-n.value;const r=B(e);e.startTime=g(e,r>=0?n:i),e.holdTime=null,e.rangeDuration!==t&&yt(e)}function he(e){throw new Error("Unsupported timeline class")}function xt(e){return e instanceof ViewTimeline?{rangeName:"cover",offset:CSS.percent(0)}:e instanceof w?CSS.percent(0):void he()}function bt(e){return e instanceof ViewTimeline?{rangeName:"cover",offset:CSS.percent(100)}:e instanceof w?CSS.percent(100):void he()}function Jt(e,t){if(!t)return{start:"normal",end:"normal"};const n={start:xt(e),end:bt(e)};if(e instanceof ViewTimeline){const i=ke(t),r=[],s=[];if(i.forEach(o=>{if(ue.includes(o))r.push(o);else try{s.push(CSSNumericValue.parse(o))}catch{throw TypeError(`Could not parse range "${t}"`)}}),r.length>2||s.length>2||s.length==1)throw TypeError("Invalid time range or unsupported time range format.");return r.length&&(n.start.rangeName=r[0],n.end.rangeName=r.length>1?r[1]:r[0]),s.length>1&&(n.start.offset=s[0],n.end.offset=s[1]),n}if(e instanceof w){const i=t.split(" ");if(i.length!=2)throw TypeError("Invalid time range or unsupported time range format.");return n.start=CSSNumericValue.parse(i[0]),n.end=CSSNumericValue.parse(i[1]),n}he()}function pe(e,t,n){if(!t||t==="normal")return"normal";if(e instanceof ViewTimeline){let i="cover",r=n==="start"?CSS.percent(0):CSS.percent(100);if(t instanceof Object)t.rangeName!==void 0&&(i=t.rangeName),t.offset!==void 0&&(r=t.offset);else{const s=ke(t);s.length===1?ue.includes(s[0])?i=s[0]:r=E(CSSNumericValue.parse(s[0]),{}):s.length===2&&(i=s[0],r=E(CSSNumericValue.parse(s[1]),{}))}if(!ue.includes(i))throw TypeError("Invalid range name");return{rangeName:i,offset:r}}if(e instanceof w)return CSSNumericValue.parse(t);he()}class de{constructor(t,n,i={}){const r=n instanceof w,s=t instanceof pt?t:new pt(t,r?void 0:n);wt.set(s,this),m.set(this,{animation:s,timeline:r?n:void 0,playState:r?"idle":null,readyPromise:null,finishedPromise:null,startTime:null,holdTime:null,rangeDuration:null,previousCurrentTime:null,autoAlignStartTime:!1,pendingPlaybackRate:null,pendingTask:null,specifiedTiming:null,normalizedTiming:null,effect:null,animationRange:r?Jt(n,i["animation-range"]):null,proxy:this})}get effect(){const t=m.get(this);return t.timeline?(t.effect||(t.effect=(function(n){const i=n.animation.effect,r=i.updateTiming,s={apply:function(c){i.getTiming();const u=c.apply(i);if(n.timeline){const f=n.duration??100;u.localTime=H(n,u.localTime),u.endTime=H(n,u.endTime),u.activeDuration=H(n,u.activeDuration);const h=U(n),d=u.iterations?(h-u.delay-u.endDelay)/u.iterations:0;u.duration=h?CSS.percent(f*d/h):CSS.percent(0),n.timeline.currentTime===void 0&&(u.localTime=null)}return u}},o={apply:function(c,u){if(n.specifiedTiming)return n.specifiedTiming;n.specifiedTiming=c.apply(i);let f,h=Object.assign({},n.specifiedTiming);if(h.duration===1/0)throw TypeError("Effect duration cannot be Infinity when used with Scroll Timelines");return(h.duration===null||h.duration==="auto"||n.autoDurationEffect)&&n.timeline&&(n.autoDurationEffect=!0,h.delay=0,h.endDelay=0,f=h.iterations?1e5:0,h.duration=h.iterations?(f-h.delay-h.endDelay)/h.iterations:0,h.duration<0&&(h.duration=0,h.endDelay=f-h.delay),r.apply(i,[h])),n.normalizedTiming=h,n.specifiedTiming}},l={apply:function(c,u,f){if(f&&f.length){if(n.timeline&&f[0]){const h=f[0],d=h.duration;if(d===1/0)throw TypeError("Effect duration cannot be Infinity when used with Scroll Timelines");if(h.iterations===1/0)throw TypeError("Effect iterations cannot be Infinity when used with Scroll Timelines");d!==void 0&&d!=="auto"&&(n.autoDurationEffect=null)}n.specifiedTiming&&c.apply(i,[n.specifiedTiming]),c.apply(i,f),yt(n)}}},a=new Proxy(i,{get:function(c,u){const f=c[u];return typeof f=="function"?f.bind(i):f},set:function(c,u,f){return c[u]=f,!0}});return a.getComputedTiming=new Proxy(i.getComputedTiming,s),a.getTiming=new Proxy(i.getTiming,o),a.updateTiming=new Proxy(i.updateTiming,l),a})(t)),t.effect):t.animation.effect}set effect(t){const n=m.get(this);n.animation.effect=t,n.effect=null,n.autoDurationEffect=null}get timeline(){const t=m.get(this);return t.timeline||t.animation.timeline}set timeline(t){const n=m.get(this),i=this.timeline;if(i==t)return;const r=this.playState,s=this.currentTime;let o,l=U(n);o=s===null?null:l===0?0:g(n,s)/l;const a=i instanceof w,c=t instanceof w,u=this.pending;if(a&&_e(n.timeline,n.animation),c)return n.timeline=t,R(n),n.autoAlignStartTime=!0,n.startTime=null,n.holdTime=null,r!=="running"&&r!=="finished"||(n.readyPromise&&n.readyPromise.state!=="resolved"||ne(n),n.pendingTask="play",je(n.timeline,n.animation,Fe.bind(this))),r==="paused"&&o!==null&&(n.holdTime=o*l),u&&(n.readyPromise&&n.readyPromise.state!="resolved"||ne(n),n.pendingTask=r=="paused"?"pause":"play"),n.startTime!==null&&(n.holdTime=null),void O(n,!1,!1);if(n.animation.timeline!=t)throw TypeError("Unsupported timeline: "+t);if(_e(n.timeline,n.animation),n.timeline=null,a)switch(s!==null&&(n.animation.currentTime=o*U(n)),r){case"paused":n.animation.pause();break;case"running":case"finished":n.animation.play()}}get startTime(){const t=m.get(this);return t.timeline?H(t,t.startTime):t.animation.startTime}set startTime(t){const n=m.get(this);if(t=g(n,t),!n.timeline)return void(n.animation.startTime=t);n.autoAlignStartTime=!1,g(n,n.timeline.currentTime)==null&&n.startTime!=null&&(n.holdTime=null,_(n));const i=g(n,this.currentTime);R(n),n.startTime=t,n.startTime!==null&&n.animation.playbackRate!=0?n.holdTime=null:n.holdTime=i,n.pendingTask&&(n.pendingTask=null,n.readyPromise.resolve(this)),O(n,!0,!1),_(n)}get currentTime(){const t=m.get(this);return t.timeline?t.holdTime!=null?H(t,t.holdTime):H(t,Tt(t)):t.animation.currentTime}set currentTime(t){const n=m.get(this);n.timeline?((function(i,r){if(r==null&&i.currentTime!==null)throw new TypeError;r=g(i,r),i.autoAlignStartTime=!1,i.holdTime!==null||i.startTime===null||i.timeline.phase==="inactive"||i.animation.playbackRate===0?i.holdTime=r:i.startTime=g(i,i.timeline.currentTime)-r/i.animation.playbackRate,i.timeline.phase==="inactive"&&(i.startTime=null),i.previousCurrentTime=null})(n,t),n.pendingTask=="pause"&&(n.holdTime=g(n,t),R(n),n.startTime=null,n.pendingTask=null,n.readyPromise.resolve(this)),O(n,!0,!1)):n.animation.currentTime=t}get playbackRate(){return m.get(this).animation.playbackRate}set playbackRate(t){const n=m.get(this);if(!n.timeline)return void(n.animation.playbackRate=t);n.pendingPlaybackRate=null;const i=this.currentTime;n.animation.playbackRate=t,i!==null&&(this.currentTime=i)}get playState(){const t=m.get(this);if(!t.timeline)return t.animation.playState;const n=g(t,this.currentTime);return n===null&&t.startTime===null&&t.pendingTask==null?"idle":t.pendingTask=="pause"||t.startTime===null&&t.pendingTask!="play"?"paused":n!=null&&(t.animation.playbackRate>0&&n>=U(t)||t.animation.playbackRate<0&&n<=0)?"finished":"running"}get rangeStart(){var t;return((t=m.get(this).animationRange)==null?void 0:t.start)??"normal"}set rangeStart(t){const n=m.get(this);if(!n.timeline)return n.animation.rangeStart=t;n.timeline instanceof w&&(n.animationRange.start=pe(n.timeline,t,"start"),fe(n),_(n))}get rangeEnd(){var t;return((t=m.get(this).animationRange)==null?void 0:t.end)??"normal"}set rangeEnd(t){const n=m.get(this);if(!n.timeline)return n.animation.rangeEnd=t;n.timeline instanceof w&&(n.animationRange.end=pe(n.timeline,t,"end"),fe(n),_(n))}get replaceState(){return m.get(this).animation.pending}get pending(){const t=m.get(this);return t.timeline?!!t.readyPromise&&t.readyPromise.state=="pending":t.animation.pending}finish(){const t=m.get(this);if(!t.timeline)return void t.animation.finish();const n=B(t),i=U(t);if(n==0)throw new DOMException("Cannot finish Animation with a playbackRate of 0.","InvalidStateError");if(n>0&&i==1/0)throw new DOMException("Cannot finish Animation with an infinite target effect end.","InvalidStateError");R(t);const r=n<0?0:i;this.currentTime=H(t,r);const s=g(t,t.timeline.currentTime);t.startTime===null&&s!==null&&(t.startTime=s-r/t.animation.playbackRate),t.pendingTask=="pause"&&t.startTime!==null&&(t.holdTime=null,t.pendingTask=null,t.readyPromise.resolve(this)),t.pendingTask=="play"&&t.startTime!==null&&(t.pendingTask=null,t.readyPromise.resolve(this)),O(t,!0,!0)}play(){const t=m.get(this);t.timeline?$e(t):t.animation.play()}pause(){const t=m.get(this);t.timeline?this.playState!="paused"&&(t.animation.currentTime===null&&(t.autoAlignStartTime=!0),t.pendingTask=="play"?t.pendingTask=null:t.readyPromise=null,t.readyPromise||ne(t),t.pendingTask="pause",je(t.timeline,t.animation,Fe.bind(t.proxy))):t.animation.pause()}reverse(){const t=m.get(this),n=B(t),i=g(t,this.currentTime),r=U(t)==1/0,s=n!=0&&(n<0||i>0||!r);if(!t.timeline||!s)return s&&(t.pendingPlaybackRate=-B(t)),void t.animation.reverse();if(t.timeline.phase=="inactive")throw new DOMException("Cannot reverse an animation with no active timeline","InvalidStateError");this.updatePlaybackRate(-n),$e(t)}updatePlaybackRate(t){const n=m.get(this);if(n.pendingPlaybackRate=t,!n.timeline)return void n.animation.updatePlaybackRate(t);const i=this.playState;if(!n.readyPromise||n.readyPromise.state!="pending")switch(i){case"idle":case"paused":R(n);break;case"finished":const r=g(n,n.timeline.currentTime),s=r!==null?(r-n.startTime)*n.animation.playbackRate:null;n.startTime=t==0?r:r!=null&&s!=null?(r-s)/t:null,R(n),O(n,!1,!1),_(n);break;default:$e(n)}}persist(){m.get(this).animation.persist()}get id(){return m.get(this).animation.id}set id(t){m.get(this).animation.id=t}cancel(){const t=m.get(this);t.timeline?(this.playState!="idle"&&((function(n){n.pendingTask&&(n.pendingTask=null,R(n),n.readyPromise.reject(dt()),ne(n),n.readyPromise.resolve(n.proxy))})(t),t.finishedPromise&&t.finishedPromise.state=="pending"&&t.finishedPromise.reject(dt()),t.finishedPromise=new K,t.animation.cancel()),t.startTime=null,t.holdTime=null,_e(t.timeline,t.animation)):t.animation.cancel()}get onfinish(){return m.get(this).animation.onfinish}set onfinish(t){m.get(this).animation.onfinish=t}get oncancel(){return m.get(this).animation.oncancel}set oncancel(t){m.get(this).animation.oncancel=t}get onremove(){return m.get(this).animation.onremove}set onremove(t){m.get(this).animation.onremove=t}get finished(){const t=m.get(this);return t.timeline?(t.finishedPromise||(t.finishedPromise=new K),t.finishedPromise.promise):t.animation.finished}get ready(){const t=m.get(this);return t.timeline?(t.readyPromise||(t.readyPromise=new K,t.readyPromise.resolve(this)),t.readyPromise.promise):t.animation.ready}addEventListener(t,n,i){m.get(this).animation.addEventListener(t,n,i)}removeEventListener(t,n,i){m.get(this).animation.removeEventListener(t,n,i)}dispatchEvent(t){m.get(this).animation.dispatchEvent(t)}}function Zt(e,t){const n=t.timeline;n instanceof w&&delete t.timeline;const i=Yt.apply(this,[e,t]),r=new de(i,n);return n instanceof w&&(i.pause(),m.get(r).animationRange={start:pe(n,t.rangeStart,"start"),end:pe(n,t.rangeEnd,"end")},r.play()),r}function Et(e){for(let t=0;t<e.length;++t){const n=wt.get(e[t]);n&&(e[t]=n)}return e}function en(e){return Et(Xt.apply(this,[e]))}function tn(e){return Et(Qt.apply(this,[e]))}const T={IDENTIFIER:/[\w\\\@_-]+/g,WHITE_SPACE:/\s*/g,TIME:/^[0-9]+(s|ms)/,SCROLL_TIMELINE:/scroll-timeline\s*:([^;}]+)/,SCROLL_TIMELINE_NAME:/scroll-timeline-name\s*:([^;}]+)/,SCROLL_TIMELINE_AXIS:/scroll-timeline-axis\s*:([^;}]+)/,VIEW_TIMELINE:/view-timeline\s*:([^;}]+)/,VIEW_TIMELINE_NAME:/view-timeline-name\s*:([^;}]+)/,VIEW_TIMELINE_AXIS:/view-timeline-axis\s*:([^;}]+)/,VIEW_TIMELINE_INSET:/view-timeline-inset\s*:([^;}]+)/,ANIMATION_TIMELINE:/animation-timeline\s*:([^;}]+)/,ANIMATION_TIME_RANGE:/animation-range\s*:([^;}]+)/,ANIMATION_NAME:/animation-name\s*:([^;}]+)/,ANIMATION:/animation\s*:([^;}]+)/,ANONYMOUS_SCROLL_TIMELINE:/scroll\(([^)]*)\)/,ANONYMOUS_VIEW_TIMELINE:/view\(([^)]*)\)/},G=["block","inline","x","y"],nn=["nearest","root","self"],W=new class{constructor(){this.cssRulesWithTimelineName=[],this.nextAnonymousTimelineNameIndex=0,this.anonymousScrollTimelineOptions=new Map,this.anonymousViewTimelineOptions=new Map,this.sourceSelectorToScrollTimeline=[],this.subjectSelectorToViewTimeline=[],this.keyframeNamesSelectors=new Map}transpileStyleSheet(e,t,n){const i={sheetSrc:e,index:0,name:n};for(;i.index<i.sheetSrc.length&&(this.eatWhitespace(i),!(i.index>=i.sheetSrc.length));){if(this.lookAhead("/*",i)){for(;this.lookAhead("/*",i);)this.eatComment(i),this.eatWhitespace(i);continue}const r=this.parseQualifiedRule(i);r&&(t?this.parseKeyframesAndSaveNameMapping(r,i):this.handleScrollTimelineProps(r,i))}return this.replaceUrlFunctions(i.sheetSrc,n)}replaceUrlFunctions(e,t){if(!t)return e;const n=new URL(t).origin,i=t.lastIndexOf("/")>n.length?t.substring(0,t.lastIndexOf("/")):n;return e=(e=e.replace(/url\((?:(['"])(?!https?:\/\/|data:|blob:|\/)|(?!['"]?(?:https?:\/\/|data:|blob:|\/)))(?:\.\/)?/gm,`url($1${i}/`)).replace(/url\((['"])?\//gm,`url($1${n}/`)}getAnimationTimelineOptions(e,t){for(let n=this.cssRulesWithTimelineName.length-1;n>=0;n--){const i=this.cssRulesWithTimelineName[n];try{if(t.matches(i.selector)&&(!i["animation-name"]||i["animation-name"]==e))return{"animation-timeline":i["animation-timeline"],"animation-range":i["animation-range"]}}catch{}}return null}getAnonymousScrollTimelineOptions(e,t){const n=this.anonymousScrollTimelineOptions.get(e);return n?{anonymousSource:n.source,anonymousTarget:t,source:ut(n.source??"nearest",t),axis:n.axis?n.axis:"block"}:null}getScrollTimelineOptions(e,t){const n=this.getAnonymousScrollTimelineOptions(e,t);if(n)return n;for(let i=this.sourceSelectorToScrollTimeline.length-1;i>=0;i--){const r=this.sourceSelectorToScrollTimeline[i];if(r.name==e){const s=this.findPreviousSiblingOrAncestorMatchingSelector(t,r.selector);if(s)return{source:s,...r.axis?{axis:r.axis}:{}}}}return null}findPreviousSiblingOrAncestorMatchingSelector(e,t){let n=e;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling||n.parentElement}return null}getAnonymousViewTimelineOptions(e,t){const n=this.anonymousViewTimelineOptions.get(e);return n?{subject:t,axis:n.axis?n.axis:"block",inset:n.inset?n.inset:"auto"}:null}getViewTimelineOptions(e,t){const n=this.getAnonymousViewTimelineOptions(e,t);if(n)return n;for(let i=this.subjectSelectorToViewTimeline.length-1;i>=0;i--){const r=this.subjectSelectorToViewTimeline[i];if(r.name==e){const s=this.findPreviousSiblingOrAncestorMatchingSelector(t,r.selector);if(s)return{subject:s,axis:r.axis,inset:r.inset}}}return null}handleScrollTimelineProps(e,t){if(e.selector.includes("@keyframes"))return;const n=e.block.contents.includes("animation-name:"),i=e.block.contents.includes("animation-timeline:"),r=e.block.contents.includes("animation:");if(this.saveSourceSelectorToScrollTimeline(e),this.saveSubjectSelectorToViewTimeline(e),!i&&!n&&!r)return;let s=[],o=[],l=!1;i&&(s=this.extractScrollTimelineNames(e.block.contents)),n&&(o=this.extractMatches(e.block.contents,T.ANIMATION_NAME)),i&&n||(r&&this.extractMatches(e.block.contents,T.ANIMATION).forEach(a=>{const c=this.extractAnimationName(a);c&&i&&o.push(c),i&&(this.hasDuration(a)||(this.hasAutoDuration(a)&&(e.block.contents=e.block.contents.replace("auto"," ")),e.block.contents=e.block.contents.replace(a," 1s "+a),l=!0))}),l&&this.replacePart(e.block.startIndex,e.block.endIndex,e.block.contents,t)),this.saveRelationInList(e,s,o)}saveSourceSelectorToScrollTimeline(e){const t=e.block.contents.includes("scroll-timeline:"),n=e.block.contents.includes("scroll-timeline-name:"),i=e.block.contents.includes("scroll-timeline-axis:");if(!t&&!n)return;const r=[];if(t){const o=this.extractMatches(e.block.contents,T.SCROLL_TIMELINE);for(const l of o){const a=this.split(l),c={selector:e.selector,name:""};a.length==1?c.name=a[0]:a.length==2&&(G.includes(a[0])?(c.axis=a[0],c.name=a[1]):(c.axis=a[1],c.name=a[0])),r.push(c)}}if(n){const o=this.extractMatches(e.block.contents,T.SCROLL_TIMELINE_NAME);for(let l=0;l<o.length;l++)if(l<r.length)r[l].name=o[l];else{const a={selector:e.selector,name:o[l]};r.push(a)}}let s=[];if(i){const o=this.extractMatches(e.block.contents,T.SCROLL_TIMELINE_AXIS);if(s=o.filter(l=>G.includes(l)),s.length!=o.length)throw new Error("Invalid axis")}for(let o=0;o<r.length;o++)s.length&&(r[o].axis=s[o%r.length]);this.sourceSelectorToScrollTimeline.push(...r)}saveSubjectSelectorToViewTimeline(e){const t=e.block.contents.includes("view-timeline:"),n=e.block.contents.includes("view-timeline-name:"),i=e.block.contents.includes("view-timeline-axis:"),r=e.block.contents.includes("view-timeline-inset:");if(!t&&!n)return;const s=[];if(t){const a=this.extractMatches(e.block.contents,T.VIEW_TIMELINE);for(const c of a){const u=this.split(c),f={selector:e.selector,name:"",inset:null};u.length==1?f.name=u[0]:u.length==2&&(G.includes(u[0])?(f.axis=u[0],f.name=u[1]):(f.axis=u[1],f.name=u[0])),s.push(f)}}if(n){const a=this.extractMatches(e.block.contents,T.VIEW_TIMELINE_NAME);for(let c=0;c<a.length;c++)if(c<s.length)s[c].name=a[c];else{const u={selector:e.selector,name:a[c],inset:null};s.push(u)}}let o=[],l=[];if(r&&(o=this.extractMatches(e.block.contents,T.VIEW_TIMELINE_INSET)),i){const a=this.extractMatches(e.block.contents,T.VIEW_TIMELINE_AXIS);if(l=a.filter(c=>G.includes(c)),l.length!=a.length)throw new Error("Invalid axis")}for(let a=0;a<s.length;a++)o.length&&(s[a].inset=o[a%s.length]),l.length&&(s[a].axis=l[a%s.length]);this.subjectSelectorToViewTimeline.push(...s)}hasDuration(e){return e.split(" ").filter(t=>{return n=t,T.TIME.exec(n);var n}).length>=1}hasAutoDuration(e){return e.split(" ").filter(t=>t==="auto").length>=1}saveRelationInList(e,t,n){let i=[];e.block.contents.includes("animation-range:")&&(i=this.extractMatches(e.block.contents,T.ANIMATION_TIME_RANGE));const r=Math.max(t.length,n.length,i.length);for(let s=0;s<r;s++)this.cssRulesWithTimelineName.push({selector:e.selector,"animation-timeline":t[s%t.length],...n.length?{"animation-name":n[s%n.length]}:{},...i.length?{"animation-range":i[s%i.length]}:{}})}extractScrollTimelineNames(e){const t=T.ANIMATION_TIMELINE.exec(e)[1].trim(),n=[];return t.split(",").map(i=>i.trim()).forEach(i=>{if((function(r){return(r.startsWith("scroll")||r.startsWith("view"))&&r.includes("(")})(i)){const r=this.saveAnonymousTimelineName(i);n.push(r)}else n.push(i)}),n}saveAnonymousTimelineName(e){const t=":t"+this.nextAnonymousTimelineNameIndex++;return e.startsWith("scroll(")?this.anonymousScrollTimelineOptions.set(t,this.parseAnonymousScrollTimeline(e)):this.anonymousViewTimelineOptions.set(t,this.parseAnonymousViewTimeline(e)),t}parseAnonymousScrollTimeline(e){const t=T.ANONYMOUS_SCROLL_TIMELINE.exec(e);if(!t)return null;const n=t[1],i={};return n.split(" ").forEach(r=>{G.includes(r)?i.axis=r:nn.includes(r)&&(i.source=r)}),i}parseAnonymousViewTimeline(e){const t=T.ANONYMOUS_VIEW_TIMELINE.exec(e);if(!t)return null;const n=t[1],i={};return n.split(" ").forEach(r=>{G.includes(r)?i.axis=r:i.inset=i.inset?`${i.inset} ${r}`:r}),i}extractAnimationName(e){return this.findMatchingEntryInContainer(e,this.keyframeNamesSelectors)}findMatchingEntryInContainer(e,t){const n=e.split(" ").filter(i=>t.has(i));return n?n[0]:null}parseIdentifier(e){T.IDENTIFIER.lastIndex=e.index;const t=T.IDENTIFIER.exec(e.sheetSrc);if(!t)throw this.parseError(e,"Expected an identifier");return e.index+=t[0].length,t[0]}parseKeyframesAndSaveNameMapping(e,t){if(e.selector.startsWith("@keyframes")){const n=this.replaceKeyframesAndGetMapping(e,t);e.selector.split(" ").forEach((i,r)=>{r>0&&this.keyframeNamesSelectors.set(i,n)})}}replaceKeyframesAndGetMapping(e,t){function n(a){return ue.some(c=>a.startsWith(c))}const i=e.block.contents,r=(function(a){let c=0,u=-1,f=-1;const h=[];for(let d=0;d<a.length;d++)a[d]=="{"?c++:a[d]=="}"&&c--,c==1&&a[d]!="{"&&a[d]!="}"&&u==-1&&(u=d),c==2&&a[d]=="{"&&(f=d,h.push({start:u,end:f}),u=f=-1);return h})(i);if(r.length==0)return new Map;const s=new Map;let o=!1;const l=[];l.push(i.substring(0,r[0].start));for(let a=0;a<r.length;a++){const c=i.substring(r[a].start,r[a].end),u=[];c.split(",").forEach(f=>{const h=f.split(" ").map(S=>S.trim()).filter(S=>S!="").join(" "),d=s.size;s.set(d,h),u.push(`${d}%`),n(h)&&(o=!0)}),l.push(u.join(",")),a==r.length-1?l.push(i.substring(r[a].end)):l.push(i.substring(r[a].end,r[a+1].start))}return o?(e.block.contents=l.join(""),this.replacePart(e.block.startIndex,e.block.endIndex,e.block.contents,t),s):new Map}parseQualifiedRule(e){const t=e.index,n=this.parseSelector(e).trim();if(n)return{selector:n,block:this.eatBlock(e),startIndex:t,endIndex:e.index}}removeEnclosingDoubleQuotes(e){const t=e[0]=='"'?1:0,n=e[e.length-1]=='"'?e.length-1:e.length;return e.substring(t,n)}assertString(e,t){if(e.sheetSrc.substr(e.index,t.length)!=t)throw this.parseError(e,`Did not find expected sequence ${t}`);e.index+=t.length}replacePart(e,t,n,i){if(i.sheetSrc=i.sheetSrc.slice(0,e)+n+i.sheetSrc.slice(t),i.index>=t){const r=i.index-t;i.index=e+n.length+r}}eatComment(e){this.assertString(e,"/*"),this.eatUntil("*/",e,!0),this.assertString(e,"*/")}eatBlock(e){const t=e.index;this.assertString(e,"{");let n=1;for(;n!=0;)this.lookAhead("/*",e)?this.eatComment(e):(e.sheetSrc[e.index]==="{"?n++:e.sheetSrc[e.index]==="}"&&n--,this.advance(e));const i=e.index;return{startIndex:t,endIndex:i,contents:e.sheetSrc.slice(t,i)}}advance(e){if(e.index++,e.index>e.sheetSrc.length)throw this.parseError(e,"Advanced beyond the end")}parseError(e,t){return Error(`(${e.name?e.name:"<anonymous file>"}): ${t}`)}eatUntil(e,t,n=!1){const i=t.index;for(;!this.lookAhead(e,t);)this.advance(t);return n&&(t.sheetSrc=t.sheetSrc.slice(0,i)+" ".repeat(t.index-i)+t.sheetSrc.slice(t.index)),t.sheetSrc.slice(i,t.index)}parseSelector(e){const t=e.index;if(this.eatUntil("{",e),t===e.index)throw Error("Empty selector");return e.sheetSrc.slice(t,e.index)}eatWhitespace(e){T.WHITE_SPACE.lastIndex=e.index;const t=T.WHITE_SPACE.exec(e.sheetSrc);t&&(e.index+=t[0].length)}lookAhead(e,t){return t.sheetSrc.substr(t.index,e.length)==e}peek(e){return e.sheetSrc[e.index]}extractMatches(e,t,n=","){return t.exec(e)[1].trim().split(n).map(i=>i.trim())}split(e){return e.split(" ").map(t=>t.trim()).filter(t=>t!="")}};function rn(e,t,n,i,r,s){const o=Oe(t),l=Ue(t,n);return ht(ze(e,o,l,i,r),s,ze("cover",o,l,i,r),n)}function sn(e,t,n){const i=W.getAnimationTimelineOptions(t,n);if(!i)return null;const r=i["animation-timeline"];if(!r)return null;const s=W.getScrollTimelineOptions(r,n)||W.getViewTimelineOptions(r,n);return s?(s.subject&&(function(o,l){const a=De(l.subject),c=l.axis||l.axis;function u(h,d){let S=null;for(const[x,I]of h)if(x==100*d.offset){if(I=="from")S=0;else if(I=="to")S=100;else{const C=I.split(" ");S=C.length==1?parseFloat(C[0]):100*rn(C[0],a,l.subject,c,l.inset,CSS.percent(parseFloat(C[1])))}break}return S}const f=W.keyframeNamesSelectors.get(o.animationName);if(f&&f.size){const h=[];o.effect.getKeyframes().forEach(S=>{const x=u(f,S);x!==null&&x>=0&&x<=100&&(S.offset=x/100,h.push(S))});const d=h.sort((S,x)=>S.offset<x.offset?-1:S.affset>x.offset?1:0);o.effect.setKeyframes(d)}})(e,s),{timeline:s.source?new w(s):new q(s),animOptions:i}):null}function on(){if(CSS.supports("animation-timeline: --works"))return!0;(function(){function t(i){if(i.innerHTML.trim().length===0||"aphrodite"in i.dataset)return;let r=W.transpileStyleSheet(i.innerHTML,!0);r=W.transpileStyleSheet(r,!1),i.innerHTML=r}function n(i){i.type!="text/css"&&i.rel!="stylesheet"||!i.href||new URL(i.href,document.baseURI).origin==location.origin&&fetch(i.getAttribute("href")).then(async r=>{const s=await r.text();let o=W.transpileStyleSheet(s,!0);if(o=W.transpileStyleSheet(s,!1,r.url),o!=s){const l=new Blob([o],{type:"text/css"}),a=URL.createObjectURL(l);i.setAttribute("href",a)}})}new MutationObserver(i=>{for(const r of i)for(const s of r.addedNodes)s instanceof HTMLStyleElement&&t(s),s instanceof HTMLLinkElement&&n(s)}).observe(document.documentElement,{childList:!0,subtree:!0}),document.querySelectorAll("style").forEach(i=>t(i)),document.querySelectorAll("link").forEach(i=>n(i))})();const e=CSS.supports;CSS.supports=t=>(t=t.replaceAll(/(animation-timeline|scroll-timeline(-(name|axis))?|view-timeline(-(name|axis|inset))?|timeline-scope)\s*:/g,"--supported-property:"),e(t)),window.addEventListener("animationstart",t=>{t.target.getAnimations().filter(n=>n.animationName===t.animationName).forEach(n=>{const i=sn(n,n.animationName,t.target);if(i)if(!i.timeline||n instanceof de)n.timeline=i.timeline;else{const r=new de(n,i.timeline,i.animOptions);n.pause(),r.play()}})})}on()?console.debug("Polyfill skipped because browser supports Scroll Timeline."):(function(){if(window.ViewTimeline!==void 0)return!0;if(!Reflect.defineProperty(window,"ScrollTimeline",{value:w}))throw Error("Error installing ScrollTimeline polyfill: could not attach ScrollTimeline to window");if(!Reflect.defineProperty(window,"ViewTimeline",{value:q}))throw Error("Error installing ViewTimeline polyfill: could not attach ViewTimeline to window");if(!Reflect.defineProperty(Element.prototype,"animate",{value:Zt}))throw Error("Error installing ScrollTimeline polyfill: could not attach WAAPI's animate to DOM Element");if(!Reflect.defineProperty(window,"Animation",{value:de}))throw Error("Error installing Animation constructor.");if(!Reflect.defineProperty(Element.prototype,"getAnimations",{value:en}))throw Error("Error installing ScrollTimeline polyfill: could not attach WAAPI's getAnimations to DOM Element");if(!Reflect.defineProperty(document,"getAnimations",{value:tn}))throw Error("Error installing ScrollTimeline polyfill: could not attach WAAPI's getAnimations to document")})()})();
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
var ie=typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{},C=[],O=[],Ne=typeof Uint8Array<"u"?Uint8Array:Array,K=!1;function ae(){K=!0;for(var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",e=0,t=r.length;e<t;++e)C[e]=r[e],O[r.charCodeAt(e)]=e;O[45]=62,O[95]=63}function Fe(r){K||ae();var e,t,i,n,s,o,l=r.length;if(l%4>0)throw new Error("Invalid string. Length must be a multiple of 4");s=r[l-2]==="="?2:r[l-1]==="="?1:0,o=new Ne(l*3/4-s),i=s>0?l-4:l;var u=0;for(e=0,t=0;e<i;e+=4,t+=3)n=O[r.charCodeAt(e)]<<18|O[r.charCodeAt(e+1)]<<12|O[r.charCodeAt(e+2)]<<6|O[r.charCodeAt(e+3)],o[u++]=n>>16&255,o[u++]=n>>8&255,o[u++]=n&255;return s===2?(n=O[r.charCodeAt(e)]<<2|O[r.charCodeAt(e+1)]>>4,o[u++]=n&255):s===1&&(n=O[r.charCodeAt(e)]<<10|O[r.charCodeAt(e+1)]<<4|O[r.charCodeAt(e+2)]>>2,o[u++]=n>>8&255,o[u++]=n&255),o}function Te(r){return C[r>>18&63]+C[r>>12&63]+C[r>>6&63]+C[r&63]}function Ce(r,e,t){for(var i,n=[],s=e;s<t;s+=3)i=(r[s]<<16)+(r[s+1]<<8)+r[s+2],n.push(Te(i));return n.join("")}function ne(r){K||ae();for(var e,t=r.length,i=t%3,n="",s=[],o=16383,l=0,u=t-i;l<u;l+=o)s.push(Ce(r,l,l+o>u?u:l+o));return i===1?(e=r[t-1],n+=C[e>>2],n+=C[e<<4&63],n+="=="):i===2&&(e=(r[t-2]<<8)+r[t-1],n+=C[e>>10],n+=C[e>>4&63],n+=C[e<<2&63],n+="="),s.push(n),s.join("")}function Q(r,e,t,i,n){var s,o,l=n*8-i-1,u=(1<<l)-1,a=u>>1,h=-7,c=t?n-1:0,w=t?-1:1,y=r[e+c];for(c+=w,s=y&(1<<-h)-1,y>>=-h,h+=l;h>0;s=s*256+r[e+c],c+=w,h-=8);for(o=s&(1<<-h)-1,s>>=-h,h+=i;h>0;o=o*256+r[e+c],c+=w,h-=8);if(s===0)s=1-a;else{if(s===u)return o?NaN:(y?-1:1)*(1/0);o=o+Math.pow(2,i),s=s-a}return(y?-1:1)*o*Math.pow(2,s-i)}function ce(r,e,t,i,n,s){var o,l,u,a=s*8-n-1,h=(1<<a)-1,c=h>>1,w=n===23?Math.pow(2,-24)-Math.pow(2,-77):0,y=i?0:s-1,F=i?1:-1,x=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(l=isNaN(e)?1:0,o=h):(o=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-o))<1&&(o--,u*=2),o+c>=1?e+=w/u:e+=w*Math.pow(2,1-c),e*u>=2&&(o++,u/=2),o+c>=h?(l=0,o=h):o+c>=1?(l=(e*u-1)*Math.pow(2,n),o=o+c):(l=e*Math.pow(2,c-1)*Math.pow(2,n),o=0));n>=8;r[t+y]=l&255,y+=F,l/=256,n-=8);for(o=o<<n|l,a+=n;a>0;r[t+y]=o&255,y+=F,o/=256,a-=8);r[t+y-F]|=x*128}var De={}.toString,he=Array.isArray||function(r){return De.call(r)=="[object Array]"},ve=50;f.TYPED_ARRAY_SUPPORT=ie.TYPED_ARRAY_SUPPORT!==void 0?ie.TYPED_ARRAY_SUPPORT:!0;q();function q(){return f.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function B(r,e){if(q()<e)throw new RangeError("Invalid typed array length");return f.TYPED_ARRAY_SUPPORT?(r=new Uint8Array(e),r.__proto__=f.prototype):(r===null&&(r=new f(e)),r.length=e),r}function f(r,e,t){if(!f.TYPED_ARRAY_SUPPORT&&!(this instanceof f))return new f(r,e,t);if(typeof r=="number"){if(typeof e=="string")throw new Error("If encoding is specified then the first argument must be a string");return ee(this,r)}return _e(this,r,e,t)}f.poolSize=8192;f._augment=function(r){return r.__proto__=f.prototype,r};function _e(r,e,t,i){if(typeof e=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&e instanceof ArrayBuffer?Le(r,e,t,i):typeof e=="string"?Ue(r,e,t):Me(r,e)}f.from=function(r,e,t){return _e(null,r,e,t)};f.TYPED_ARRAY_SUPPORT&&(f.prototype.__proto__=Uint8Array.prototype,f.__proto__=Uint8Array,typeof Symbol<"u"&&Symbol.species&&f[Symbol.species]);function me(r){if(typeof r!="number")throw new TypeError('"size" argument must be a number');if(r<0)throw new RangeError('"size" argument must not be negative')}function Be(r,e,t,i){return me(e),e<=0?B(r,e):t!==void 0?typeof i=="string"?B(r,e).fill(t,i):B(r,e).fill(t):B(r,e)}f.alloc=function(r,e,t){return Be(null,r,e,t)};function ee(r,e){if(me(e),r=B(r,e<0?0:te(e)|0),!f.TYPED_ARRAY_SUPPORT)for(var t=0;t<e;++t)r[t]=0;return r}f.allocUnsafe=function(r){return ee(null,r)};f.allocUnsafeSlow=function(r){return ee(null,r)};function Ue(r,e,t){if((typeof t!="string"||t==="")&&(t="utf8"),!f.isEncoding(t))throw new TypeError('"encoding" must be a valid string encoding');var i=de(e,t)|0;r=B(r,i);var n=r.write(e,t);return n!==i&&(r=r.slice(0,n)),r}function Z(r,e){var t=e.length<0?0:te(e.length)|0;r=B(r,t);for(var i=0;i<t;i+=1)r[i]=e[i]&255;return r}function Le(r,e,t,i){if(e.byteLength,t<0||e.byteLength<t)throw new RangeError("'offset' is out of bounds");if(e.byteLength<t+(i||0))throw new RangeError("'length' is out of bounds");return t===void 0&&i===void 0?e=new Uint8Array(e):i===void 0?e=new Uint8Array(e,t):e=new Uint8Array(e,t,i),f.TYPED_ARRAY_SUPPORT?(r=e,r.__proto__=f.prototype):r=Z(r,e),r}function Me(r,e){if(D(e)){var t=te(e.length)|0;return r=B(r,t),r.length===0||e.copy(r,0,0,t),r}if(e){if(typeof ArrayBuffer<"u"&&e.buffer instanceof ArrayBuffer||"length"in e)return typeof e.length!="number"||rt(e.length)?B(r,0):Z(r,e);if(e.type==="Buffer"&&he(e.data))return Z(r,e.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function te(r){if(r>=q())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+q().toString(16)+" bytes");return r|0}f.isBuffer=N;function D(r){return!!(r!=null&&r._isBuffer)}f.compare=function(e,t){if(!D(e)||!D(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var i=e.length,n=t.length,s=0,o=Math.min(i,n);s<o;++s)if(e[s]!==t[s]){i=e[s],n=t[s];break}return i<n?-1:n<i?1:0};f.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};f.concat=function(e,t){if(!he(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return f.alloc(0);var i;if(t===void 0)for(t=0,i=0;i<e.length;++i)t+=e[i].length;var n=f.allocUnsafe(t),s=0;for(i=0;i<e.length;++i){var o=e[i];if(!D(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(n,s),s+=o.length}return n};function de(r,e){if(D(r))return r.length;if(typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(r)||r instanceof ArrayBuffer))return r.byteLength;typeof r!="string"&&(r=""+r);var t=r.length;if(t===0)return 0;for(var i=!1;;)switch(e){case"ascii":case"latin1":case"binary":return t;case"utf8":case"utf-8":case void 0:return z(r).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return t*2;case"hex":return t>>>1;case"base64":return Ee(r).length;default:if(i)return z(r).length;e=(""+e).toLowerCase(),i=!0}}f.byteLength=de;function ke(r,e,t){var i=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((t===void 0||t>this.length)&&(t=this.length),t<=0)||(t>>>=0,e>>>=0,t<=e))return"";for(r||(r="utf8");;)switch(r){case"hex":return Ge(this,e,t);case"utf8":case"utf-8":return we(this,e,t);case"ascii":return Qe(this,e,t);case"latin1":case"binary":return je(this,e,t);case"base64":return qe(this,e,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return He(this,e,t);default:if(i)throw new TypeError("Unknown encoding: "+r);r=(r+"").toLowerCase(),i=!0}}f.prototype._isBuffer=!0;function $(r,e,t){var i=r[e];r[e]=r[t],r[t]=i}f.prototype.swap16=function(){var e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)$(this,t,t+1);return this};f.prototype.swap32=function(){var e=this.length;if(e%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)$(this,t,t+3),$(this,t+1,t+2);return this};f.prototype.swap64=function(){var e=this.length;if(e%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)$(this,t,t+7),$(this,t+1,t+6),$(this,t+2,t+5),$(this,t+3,t+4);return this};f.prototype.toString=function(){var e=this.length|0;return e===0?"":arguments.length===0?we(this,0,e):ke.apply(this,arguments)};f.prototype.equals=function(e){if(!D(e))throw new TypeError("Argument must be a Buffer");return this===e?!0:f.compare(this,e)===0};f.prototype.inspect=function(){var e="",t=ve;return this.length>0&&(e=this.toString("hex",0,t).match(/.{2}/g).join(" "),this.length>t&&(e+=" ... ")),"<Buffer "+e+">"};f.prototype.compare=function(e,t,i,n,s){if(!D(e))throw new TypeError("Argument must be a Buffer");if(t===void 0&&(t=0),i===void 0&&(i=e?e.length:0),n===void 0&&(n=0),s===void 0&&(s=this.length),t<0||i>e.length||n<0||s>this.length)throw new RangeError("out of range index");if(n>=s&&t>=i)return 0;if(n>=s)return-1;if(t>=i)return 1;if(t>>>=0,i>>>=0,n>>>=0,s>>>=0,this===e)return 0;for(var o=s-n,l=i-t,u=Math.min(o,l),a=this.slice(n,s),h=e.slice(t,i),c=0;c<u;++c)if(a[c]!==h[c]){o=a[c],l=h[c];break}return o<l?-1:l<o?1:0};function pe(r,e,t,i,n){if(r.length===0)return-1;if(typeof t=="string"?(i=t,t=0):t>2147483647?t=2147483647:t<-2147483648&&(t=-2147483648),t=+t,isNaN(t)&&(t=n?0:r.length-1),t<0&&(t=r.length+t),t>=r.length){if(n)return-1;t=r.length-1}else if(t<0)if(n)t=0;else return-1;if(typeof e=="string"&&(e=f.from(e,i)),D(e))return e.length===0?-1:oe(r,e,t,i,n);if(typeof e=="number")return e=e&255,f.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?n?Uint8Array.prototype.indexOf.call(r,e,t):Uint8Array.prototype.lastIndexOf.call(r,e,t):oe(r,[e],t,i,n);throw new TypeError("val must be string, number or Buffer")}function oe(r,e,t,i,n){var s=1,o=r.length,l=e.length;if(i!==void 0&&(i=String(i).toLowerCase(),i==="ucs2"||i==="ucs-2"||i==="utf16le"||i==="utf-16le")){if(r.length<2||e.length<2)return-1;s=2,o/=2,l/=2,t/=2}function u(y,F){return s===1?y[F]:y.readUInt16BE(F*s)}var a;if(n){var h=-1;for(a=t;a<o;a++)if(u(r,a)===u(e,h===-1?0:a-h)){if(h===-1&&(h=a),a-h+1===l)return h*s}else h!==-1&&(a-=a-h),h=-1}else for(t+l>o&&(t=o-l),a=t;a>=0;a--){for(var c=!0,w=0;w<l;w++)if(u(r,a+w)!==u(e,w)){c=!1;break}if(c)return a}return-1}f.prototype.includes=function(e,t,i){return this.indexOf(e,t,i)!==-1};f.prototype.indexOf=function(e,t,i){return pe(this,e,t,i,!0)};f.prototype.lastIndexOf=function(e,t,i){return pe(this,e,t,i,!1)};function $e(r,e,t,i){t=Number(t)||0;var n=r.length-t;i?(i=Number(i),i>n&&(i=n)):i=n;var s=e.length;if(s%2!==0)throw new TypeError("Invalid hex string");i>s/2&&(i=s/2);for(var o=0;o<i;++o){var l=parseInt(e.substr(o*2,2),16);if(isNaN(l))return o;r[t+o]=l}return o}function Pe(r,e,t,i){return H(z(e,r.length-t),r,t,i)}function ge(r,e,t,i){return H(et(e),r,t,i)}function Ve(r,e,t,i){return ge(r,e,t,i)}function Je(r,e,t,i){return H(Ee(e),r,t,i)}function Ye(r,e,t,i){return H(tt(e,r.length-t),r,t,i)}f.prototype.write=function(e,t,i,n){if(t===void 0)n="utf8",i=this.length,t=0;else if(i===void 0&&typeof t=="string")n=t,i=this.length,t=0;else if(isFinite(t))t=t|0,isFinite(i)?(i=i|0,n===void 0&&(n="utf8")):(n=i,i=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var s=this.length-t;if((i===void 0||i>s)&&(i=s),e.length>0&&(i<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return $e(this,e,t,i);case"utf8":case"utf-8":return Pe(this,e,t,i);case"ascii":return ge(this,e,t,i);case"latin1":case"binary":return Ve(this,e,t,i);case"base64":return Je(this,e,t,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ye(this,e,t,i);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}};f.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function qe(r,e,t){return e===0&&t===r.length?ne(r):ne(r.slice(e,t))}function we(r,e,t){t=Math.min(r.length,t);for(var i=[],n=e;n<t;){var s=r[n],o=null,l=s>239?4:s>223?3:s>191?2:1;if(n+l<=t){var u,a,h,c;switch(l){case 1:s<128&&(o=s);break;case 2:u=r[n+1],(u&192)===128&&(c=(s&31)<<6|u&63,c>127&&(o=c));break;case 3:u=r[n+1],a=r[n+2],(u&192)===128&&(a&192)===128&&(c=(s&15)<<12|(u&63)<<6|a&63,c>2047&&(c<55296||c>57343)&&(o=c));break;case 4:u=r[n+1],a=r[n+2],h=r[n+3],(u&192)===128&&(a&192)===128&&(h&192)===128&&(c=(s&15)<<18|(u&63)<<12|(a&63)<<6|h&63,c>65535&&c<1114112&&(o=c))}}o===null?(o=65533,l=1):o>65535&&(o-=65536,i.push(o>>>10&1023|55296),o=56320|o&1023),i.push(o),n+=l}return ze(i)}var se=4096;function ze(r){var e=r.length;if(e<=se)return String.fromCharCode.apply(String,r);for(var t="",i=0;i<e;)t+=String.fromCharCode.apply(String,r.slice(i,i+=se));return t}function Qe(r,e,t){var i="";t=Math.min(r.length,t);for(var n=e;n<t;++n)i+=String.fromCharCode(r[n]&127);return i}function je(r,e,t){var i="";t=Math.min(r.length,t);for(var n=e;n<t;++n)i+=String.fromCharCode(r[n]);return i}function Ge(r,e,t){var i=r.length;(!e||e<0)&&(e=0),(!t||t<0||t>i)&&(t=i);for(var n="",s=e;s<t;++s)n+=Ke(r[s]);return n}function He(r,e,t){for(var i=r.slice(e,t),n="",s=0;s<i.length;s+=2)n+=String.fromCharCode(i[s]+i[s+1]*256);return n}f.prototype.slice=function(e,t){var i=this.length;e=~~e,t=t===void 0?i:~~t,e<0?(e+=i,e<0&&(e=0)):e>i&&(e=i),t<0?(t+=i,t<0&&(t=0)):t>i&&(t=i),t<e&&(t=e);var n;if(f.TYPED_ARRAY_SUPPORT)n=this.subarray(e,t),n.__proto__=f.prototype;else{var s=t-e;n=new f(s,void 0);for(var o=0;o<s;++o)n[o]=this[o+e]}return n};function S(r,e,t){if(r%1!==0||r<0)throw new RangeError("offset is not uint");if(r+e>t)throw new RangeError("Trying to access beyond buffer length")}f.prototype.readUIntLE=function(e,t,i){e=e|0,t=t|0,i||S(e,t,this.length);for(var n=this[e],s=1,o=0;++o<t&&(s*=256);)n+=this[e+o]*s;return n};f.prototype.readUIntBE=function(e,t,i){e=e|0,t=t|0,i||S(e,t,this.length);for(var n=this[e+--t],s=1;t>0&&(s*=256);)n+=this[e+--t]*s;return n};f.prototype.readUInt8=function(e,t){return t||S(e,1,this.length),this[e]};f.prototype.readUInt16LE=function(e,t){return t||S(e,2,this.length),this[e]|this[e+1]<<8};f.prototype.readUInt16BE=function(e,t){return t||S(e,2,this.length),this[e]<<8|this[e+1]};f.prototype.readUInt32LE=function(e,t){return t||S(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216};f.prototype.readUInt32BE=function(e,t){return t||S(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])};f.prototype.readIntLE=function(e,t,i){e=e|0,t=t|0,i||S(e,t,this.length);for(var n=this[e],s=1,o=0;++o<t&&(s*=256);)n+=this[e+o]*s;return s*=128,n>=s&&(n-=Math.pow(2,8*t)),n};f.prototype.readIntBE=function(e,t,i){e=e|0,t=t|0,i||S(e,t,this.length);for(var n=t,s=1,o=this[e+--n];n>0&&(s*=256);)o+=this[e+--n]*s;return s*=128,o>=s&&(o-=Math.pow(2,8*t)),o};f.prototype.readInt8=function(e,t){return t||S(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]};f.prototype.readInt16LE=function(e,t){t||S(e,2,this.length);var i=this[e]|this[e+1]<<8;return i&32768?i|4294901760:i};f.prototype.readInt16BE=function(e,t){t||S(e,2,this.length);var i=this[e+1]|this[e]<<8;return i&32768?i|4294901760:i};f.prototype.readInt32LE=function(e,t){return t||S(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24};f.prototype.readInt32BE=function(e,t){return t||S(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]};f.prototype.readFloatLE=function(e,t){return t||S(e,4,this.length),Q(this,e,!0,23,4)};f.prototype.readFloatBE=function(e,t){return t||S(e,4,this.length),Q(this,e,!1,23,4)};f.prototype.readDoubleLE=function(e,t){return t||S(e,8,this.length),Q(this,e,!0,52,8)};f.prototype.readDoubleBE=function(e,t){return t||S(e,8,this.length),Q(this,e,!1,52,8)};function A(r,e,t,i,n,s){if(!D(r))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>n||e<s)throw new RangeError('"value" argument is out of bounds');if(t+i>r.length)throw new RangeError("Index out of range")}f.prototype.writeUIntLE=function(e,t,i,n){if(e=+e,t=t|0,i=i|0,!n){var s=Math.pow(2,8*i)-1;A(this,e,t,i,s,0)}var o=1,l=0;for(this[t]=e&255;++l<i&&(o*=256);)this[t+l]=e/o&255;return t+i};f.prototype.writeUIntBE=function(e,t,i,n){if(e=+e,t=t|0,i=i|0,!n){var s=Math.pow(2,8*i)-1;A(this,e,t,i,s,0)}var o=i-1,l=1;for(this[t+o]=e&255;--o>=0&&(l*=256);)this[t+o]=e/l&255;return t+i};f.prototype.writeUInt8=function(e,t,i){return e=+e,t=t|0,i||A(this,e,t,1,255,0),f.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=e&255,t+1};function j(r,e,t,i){e<0&&(e=65535+e+1);for(var n=0,s=Math.min(r.length-t,2);n<s;++n)r[t+n]=(e&255<<8*(i?n:1-n))>>>(i?n:1-n)*8}f.prototype.writeUInt16LE=function(e,t,i){return e=+e,t=t|0,i||A(this,e,t,2,65535,0),f.TYPED_ARRAY_SUPPORT?(this[t]=e&255,this[t+1]=e>>>8):j(this,e,t,!0),t+2};f.prototype.writeUInt16BE=function(e,t,i){return e=+e,t=t|0,i||A(this,e,t,2,65535,0),f.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=e&255):j(this,e,t,!1),t+2};function G(r,e,t,i){e<0&&(e=4294967295+e+1);for(var n=0,s=Math.min(r.length-t,4);n<s;++n)r[t+n]=e>>>(i?n:3-n)*8&255}f.prototype.writeUInt32LE=function(e,t,i){return e=+e,t=t|0,i||A(this,e,t,4,4294967295,0),f.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=e&255):G(this,e,t,!0),t+4};f.prototype.writeUInt32BE=function(e,t,i){return e=+e,t=t|0,i||A(this,e,t,4,4294967295,0),f.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255):G(this,e,t,!1),t+4};f.prototype.writeIntLE=function(e,t,i,n){if(e=+e,t=t|0,!n){var s=Math.pow(2,8*i-1);A(this,e,t,i,s-1,-s)}var o=0,l=1,u=0;for(this[t]=e&255;++o<i&&(l*=256);)e<0&&u===0&&this[t+o-1]!==0&&(u=1),this[t+o]=(e/l>>0)-u&255;return t+i};f.prototype.writeIntBE=function(e,t,i,n){if(e=+e,t=t|0,!n){var s=Math.pow(2,8*i-1);A(this,e,t,i,s-1,-s)}var o=i-1,l=1,u=0;for(this[t+o]=e&255;--o>=0&&(l*=256);)e<0&&u===0&&this[t+o+1]!==0&&(u=1),this[t+o]=(e/l>>0)-u&255;return t+i};f.prototype.writeInt8=function(e,t,i){return e=+e,t=t|0,i||A(this,e,t,1,127,-128),f.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=e&255,t+1};f.prototype.writeInt16LE=function(e,t,i){return e=+e,t=t|0,i||A(this,e,t,2,32767,-32768),f.TYPED_ARRAY_SUPPORT?(this[t]=e&255,this[t+1]=e>>>8):j(this,e,t,!0),t+2};f.prototype.writeInt16BE=function(e,t,i){return e=+e,t=t|0,i||A(this,e,t,2,32767,-32768),f.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=e&255):j(this,e,t,!1),t+2};f.prototype.writeInt32LE=function(e,t,i){return e=+e,t=t|0,i||A(this,e,t,4,2147483647,-2147483648),f.TYPED_ARRAY_SUPPORT?(this[t]=e&255,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):G(this,e,t,!0),t+4};f.prototype.writeInt32BE=function(e,t,i){return e=+e,t=t|0,i||A(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),f.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255):G(this,e,t,!1),t+4};function xe(r,e,t,i,n,s){if(t+i>r.length)throw new RangeError("Index out of range");if(t<0)throw new RangeError("Index out of range")}function ye(r,e,t,i,n){return n||xe(r,e,t,4),ce(r,e,t,i,23,4),t+4}f.prototype.writeFloatLE=function(e,t,i){return ye(this,e,t,!0,i)};f.prototype.writeFloatBE=function(e,t,i){return ye(this,e,t,!1,i)};function Ie(r,e,t,i,n){return n||xe(r,e,t,8),ce(r,e,t,i,52,8),t+8}f.prototype.writeDoubleLE=function(e,t,i){return Ie(this,e,t,!0,i)};f.prototype.writeDoubleBE=function(e,t,i){return Ie(this,e,t,!1,i)};f.prototype.copy=function(e,t,i,n){if(i||(i=0),!n&&n!==0&&(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<i&&(n=i),n===i||e.length===0||this.length===0)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(i<0||i>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-i&&(n=e.length-t+i);var s=n-i,o;if(this===e&&i<t&&t<n)for(o=s-1;o>=0;--o)e[o+t]=this[o+i];else if(s<1e3||!f.TYPED_ARRAY_SUPPORT)for(o=0;o<s;++o)e[o+t]=this[o+i];else Uint8Array.prototype.set.call(e,this.subarray(i,i+s),t);return s};f.prototype.fill=function(e,t,i,n){if(typeof e=="string"){if(typeof t=="string"?(n=t,t=0,i=this.length):typeof i=="string"&&(n=i,i=this.length),e.length===1){var s=e.charCodeAt(0);s<256&&(e=s)}if(n!==void 0&&typeof n!="string")throw new TypeError("encoding must be a string");if(typeof n=="string"&&!f.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else typeof e=="number"&&(e=e&255);if(t<0||this.length<t||this.length<i)throw new RangeError("Out of range index");if(i<=t)return this;t=t>>>0,i=i===void 0?this.length:i>>>0,e||(e=0);var o;if(typeof e=="number")for(o=t;o<i;++o)this[o]=e;else{var l=D(e)?e:z(new f(e,n).toString()),u=l.length;for(o=0;o<i-t;++o)this[o+t]=l[o%u]}return this};var We=/[^+\/0-9A-Za-z-_]/g;function Xe(r){if(r=Ze(r).replace(We,""),r.length<2)return"";for(;r.length%4!==0;)r=r+"=";return r}function Ze(r){return r.trim?r.trim():r.replace(/^\s+|\s+$/g,"")}function Ke(r){return r<16?"0"+r.toString(16):r.toString(16)}function z(r,e){e=e||1/0;for(var t,i=r.length,n=null,s=[],o=0;o<i;++o){if(t=r.charCodeAt(o),t>55295&&t<57344){if(!n){if(t>56319){(e-=3)>-1&&s.push(239,191,189);continue}else if(o+1===i){(e-=3)>-1&&s.push(239,191,189);continue}n=t;continue}if(t<56320){(e-=3)>-1&&s.push(239,191,189),n=t;continue}t=(n-55296<<10|t-56320)+65536}else n&&(e-=3)>-1&&s.push(239,191,189);if(n=null,t<128){if((e-=1)<0)break;s.push(t)}else if(t<2048){if((e-=2)<0)break;s.push(t>>6|192,t&63|128)}else if(t<65536){if((e-=3)<0)break;s.push(t>>12|224,t>>6&63|128,t&63|128)}else if(t<1114112){if((e-=4)<0)break;s.push(t>>18|240,t>>12&63|128,t>>6&63|128,t&63|128)}else throw new Error("Invalid code point")}return s}function et(r){for(var e=[],t=0;t<r.length;++t)e.push(r.charCodeAt(t)&255);return e}function tt(r,e){for(var t,i,n,s=[],o=0;o<r.length&&!((e-=2)<0);++o)t=r.charCodeAt(o),i=t>>8,n=t%256,s.push(n),s.push(i);return s}function Ee(r){return Fe(Xe(r))}function H(r,e,t,i){for(var n=0;n<i&&!(n+t>=e.length||n>=r.length);++n)e[n+t]=r[n];return n}function rt(r){return r!==r}function N(r){return r!=null&&(!!r._isBuffer||Se(r)||it(r))}function Se(r){return!!r.constructor&&typeof r.constructor.isBuffer=="function"&&r.constructor.isBuffer(r)}function it(r){return typeof r.readFloatLE=="function"&&typeof r.slice=="function"&&Se(r.slice(0,0))}class m extends Error{constructor(e,t,i,...n){Array.isArray(t)&&(t=t.join(" ").trim()),super(t),Error.captureStackTrace!==void 0&&Error.captureStackTrace(this,m),this.code=e;for(const s of n)for(const o in s){const l=s[o];this[o]=N(l)?l.toString(i.encoding):l==null?l:JSON.parse(JSON.stringify(l))}}}const nt=function(r){return typeof r=="object"&&r!==null&&!Array.isArray(r)},Re=function(r){const e=[];for(let t=0,i=r.length;t<i;t++){const n=r[t];if(n==null||n===!1)e[t]={disabled:!0};else if(typeof n=="string")e[t]={name:n};else if(nt(n)){if(typeof n.name!="string")throw new m("CSV_OPTION_COLUMNS_MISSING_NAME",["Option columns missing name:",`property "name" is required at position ${t}`,"when column is an object literal"]);e[t]=n}else throw new m("CSV_INVALID_COLUMN_DEFINITION",["Invalid column definition:","expect a string or a literal object,",`got ${JSON.stringify(n)} at position ${t}`])}return e};class fe{constructor(e=100){this.size=e,this.length=0,this.buf=f.allocUnsafe(e)}prepend(e){if(N(e)){const t=this.length+e.length;if(t>=this.size&&(this.resize(),t>=this.size))throw Error("INVALID_BUFFER_STATE");const i=this.buf;this.buf=f.allocUnsafe(this.size),e.copy(this.buf,0),i.copy(this.buf,e.length),this.length+=e.length}else{const t=this.length++;t===this.size&&this.resize();const i=this.clone();this.buf[0]=e,i.copy(this.buf,1,0,t)}}append(e){const t=this.length++;t===this.size&&this.resize(),this.buf[t]=e}clone(){return f.from(this.buf.slice(0,this.length))}resize(){const e=this.length;this.size=this.size*2;const t=f.allocUnsafe(this.size);this.buf.copy(t,0,0,e),this.buf=t}toString(e){return e?this.buf.slice(0,this.length).toString(e):Uint8Array.prototype.slice.call(this.buf.slice(0,this.length))}toJSON(){return this.toString("utf8")}reset(){this.length=0}}const ot=12,st=13,ft=10,lt=32,ut=9,at=function(r){return{bomSkipped:!1,bufBytesStart:0,castField:r.cast_function,commenting:!1,error:void 0,enabled:r.from_line===1,escaping:!1,escapeIsQuote:N(r.escape)&&N(r.quote)&&f.compare(r.escape,r.quote)===0,expectedRecordLength:Array.isArray(r.columns)?r.columns.length:void 0,field:new fe(20),firstLineToHeaders:r.cast_first_line_to_header,needMoreDataSize:Math.max(r.comment!==null?r.comment.length:0,...r.delimiter.map(e=>e.length),r.quote!==null?r.quote.length:0),previousBuf:void 0,quoting:!1,stop:!1,rawBuffer:new fe(100),record:[],recordHasError:!1,record_length:0,recordDelimiterMaxLength:r.record_delimiter.length===0?0:Math.max(...r.record_delimiter.map(e=>e.length)),trimChars:[f.from(" ",r.encoding)[0],f.from(" ",r.encoding)[0]],wasQuoting:!1,wasRowDelimiter:!1,timchars:[f.from(f.from([st],"utf8").toString(),r.encoding),f.from(f.from([ft],"utf8").toString(),r.encoding),f.from(f.from([ot],"utf8").toString(),r.encoding),f.from(f.from([lt],"utf8").toString(),r.encoding),f.from(f.from([ut],"utf8").toString(),r.encoding)]}},ct=function(r){return r.replace(/([A-Z])/g,function(e,t){return"_"+t.toLowerCase()})},le=function(r){const e={};for(const i in r)e[ct(i)]=r[i];if(e.encoding===void 0||e.encoding===!0)e.encoding="utf8";else if(e.encoding===null||e.encoding===!1)e.encoding=null;else if(typeof e.encoding!="string"&&e.encoding!==null)throw new m("CSV_INVALID_OPTION_ENCODING",["Invalid option encoding:","encoding must be a string or null to return a buffer,",`got ${JSON.stringify(e.encoding)}`],e);if(e.bom===void 0||e.bom===null||e.bom===!1)e.bom=!1;else if(e.bom!==!0)throw new m("CSV_INVALID_OPTION_BOM",["Invalid option bom:","bom must be true,",`got ${JSON.stringify(e.bom)}`],e);if(e.cast_function=null,e.cast===void 0||e.cast===null||e.cast===!1||e.cast==="")e.cast=void 0;else if(typeof e.cast=="function")e.cast_function=e.cast,e.cast=!0;else if(e.cast!==!0)throw new m("CSV_INVALID_OPTION_CAST",["Invalid option cast:","cast must be true or a function,",`got ${JSON.stringify(e.cast)}`],e);if(e.cast_date===void 0||e.cast_date===null||e.cast_date===!1||e.cast_date==="")e.cast_date=!1;else if(e.cast_date===!0)e.cast_date=function(i){const n=Date.parse(i);return isNaN(n)?i:new Date(n)};else if(typeof e.cast_date!="function")throw new m("CSV_INVALID_OPTION_CAST_DATE",["Invalid option cast_date:","cast_date must be true or a function,",`got ${JSON.stringify(e.cast_date)}`],e);if(e.cast_first_line_to_header=void 0,e.columns===!0)e.cast_first_line_to_header=void 0;else if(typeof e.columns=="function")e.cast_first_line_to_header=e.columns,e.columns=!0;else if(Array.isArray(e.columns))e.columns=Re(e.columns);else if(e.columns===void 0||e.columns===null||e.columns===!1)e.columns=!1;else throw new m("CSV_INVALID_OPTION_COLUMNS",["Invalid option columns:","expect an array, a function or true,",`got ${JSON.stringify(e.columns)}`],e);if(e.group_columns_by_name===void 0||e.group_columns_by_name===null||e.group_columns_by_name===!1)e.group_columns_by_name=!1;else{if(e.group_columns_by_name!==!0)throw new m("CSV_INVALID_OPTION_GROUP_COLUMNS_BY_NAME",["Invalid option group_columns_by_name:","expect an boolean,",`got ${JSON.stringify(e.group_columns_by_name)}`],e);if(e.columns===!1)throw new m("CSV_INVALID_OPTION_GROUP_COLUMNS_BY_NAME",["Invalid option group_columns_by_name:","the `columns` mode must be activated."],e)}if(e.comment===void 0||e.comment===null||e.comment===!1||e.comment==="")e.comment=null;else if(typeof e.comment=="string"&&(e.comment=f.from(e.comment,e.encoding)),!N(e.comment))throw new m("CSV_INVALID_OPTION_COMMENT",["Invalid option comment:","comment must be a buffer or a string,",`got ${JSON.stringify(e.comment)}`],e);if(e.comment_no_infix===void 0||e.comment_no_infix===null||e.comment_no_infix===!1)e.comment_no_infix=!1;else if(e.comment_no_infix!==!0)throw new m("CSV_INVALID_OPTION_COMMENT",["Invalid option comment_no_infix:","value must be a boolean,",`got ${JSON.stringify(e.comment_no_infix)}`],e);const t=JSON.stringify(e.delimiter);if(Array.isArray(e.delimiter)||(e.delimiter=[e.delimiter]),e.delimiter.length===0)throw new m("CSV_INVALID_OPTION_DELIMITER",["Invalid option delimiter:","delimiter must be a non empty string or buffer or array of string|buffer,",`got ${t}`],e);if(e.delimiter=e.delimiter.map(function(i){if(i==null||i===!1)return f.from(",",e.encoding);if(typeof i=="string"&&(i=f.from(i,e.encoding)),!N(i)||i.length===0)throw new m("CSV_INVALID_OPTION_DELIMITER",["Invalid option delimiter:","delimiter must be a non empty string or buffer or array of string|buffer,",`got ${t}`],e);return i}),e.escape===void 0||e.escape===!0?e.escape=f.from('"',e.encoding):typeof e.escape=="string"?e.escape=f.from(e.escape,e.encoding):(e.escape===null||e.escape===!1)&&(e.escape=null),e.escape!==null&&!N(e.escape))throw new Error(`Invalid Option: escape must be a buffer, a string or a boolean, got ${JSON.stringify(e.escape)}`);if(e.from===void 0||e.from===null)e.from=1;else if(typeof e.from=="string"&&/\d+/.test(e.from)&&(e.from=parseInt(e.from)),Number.isInteger(e.from)){if(e.from<0)throw new Error(`Invalid Option: from must be a positive integer, got ${JSON.stringify(r.from)}`)}else throw new Error(`Invalid Option: from must be an integer, got ${JSON.stringify(e.from)}`);if(e.from_line===void 0||e.from_line===null)e.from_line=1;else if(typeof e.from_line=="string"&&/\d+/.test(e.from_line)&&(e.from_line=parseInt(e.from_line)),Number.isInteger(e.from_line)){if(e.from_line<=0)throw new Error(`Invalid Option: from_line must be a positive integer greater than 0, got ${JSON.stringify(r.from_line)}`)}else throw new Error(`Invalid Option: from_line must be an integer, got ${JSON.stringify(r.from_line)}`);if(e.ignore_last_delimiters===void 0||e.ignore_last_delimiters===null)e.ignore_last_delimiters=!1;else if(typeof e.ignore_last_delimiters=="number")e.ignore_last_delimiters=Math.floor(e.ignore_last_delimiters),e.ignore_last_delimiters===0&&(e.ignore_last_delimiters=!1);else if(typeof e.ignore_last_delimiters!="boolean")throw new m("CSV_INVALID_OPTION_IGNORE_LAST_DELIMITERS",["Invalid option `ignore_last_delimiters`:","the value must be a boolean value or an integer,",`got ${JSON.stringify(e.ignore_last_delimiters)}`],e);if(e.ignore_last_delimiters===!0&&e.columns===!1)throw new m("CSV_IGNORE_LAST_DELIMITERS_REQUIRES_COLUMNS",["The option `ignore_last_delimiters`","requires the activation of the `columns` option"],e);if(e.info===void 0||e.info===null||e.info===!1)e.info=!1;else if(e.info!==!0)throw new Error(`Invalid Option: info must be true, got ${JSON.stringify(e.info)}`);if(e.max_record_size===void 0||e.max_record_size===null||e.max_record_size===!1)e.max_record_size=0;else if(!(Number.isInteger(e.max_record_size)&&e.max_record_size>=0))if(typeof e.max_record_size=="string"&&/\d+/.test(e.max_record_size))e.max_record_size=parseInt(e.max_record_size);else throw new Error(`Invalid Option: max_record_size must be a positive integer, got ${JSON.stringify(e.max_record_size)}`);if(e.objname===void 0||e.objname===null||e.objname===!1)e.objname=void 0;else if(N(e.objname)){if(e.objname.length===0)throw new Error("Invalid Option: objname must be a non empty buffer");e.encoding===null||(e.objname=e.objname.toString(e.encoding))}else if(typeof e.objname=="string"){if(e.objname.length===0)throw new Error("Invalid Option: objname must be a non empty string")}else if(typeof e.objname!="number")throw new Error(`Invalid Option: objname must be a string or a buffer, got ${e.objname}`);if(e.objname!==void 0){if(typeof e.objname=="number"){if(e.columns!==!1)throw Error("Invalid Option: objname index cannot be combined with columns or be defined as a field")}else if(e.columns===!1)throw Error("Invalid Option: objname field must be combined with columns or be defined as an index")}if(e.on_record===void 0||e.on_record===null)e.on_record=void 0;else if(typeof e.on_record!="function")throw new m("CSV_INVALID_OPTION_ON_RECORD",["Invalid option `on_record`:","expect a function,",`got ${JSON.stringify(e.on_record)}`],e);if(e.on_skip!==void 0&&e.on_skip!==null&&typeof e.on_skip!="function")throw new Error(`Invalid Option: on_skip must be a function, got ${JSON.stringify(e.on_skip)}`);if(e.quote===null||e.quote===!1||e.quote==="")e.quote=null;else if(e.quote===void 0||e.quote===!0?e.quote=f.from('"',e.encoding):typeof e.quote=="string"&&(e.quote=f.from(e.quote,e.encoding)),!N(e.quote))throw new Error(`Invalid Option: quote must be a buffer or a string, got ${JSON.stringify(e.quote)}`);if(e.raw===void 0||e.raw===null||e.raw===!1)e.raw=!1;else if(e.raw!==!0)throw new Error(`Invalid Option: raw must be true, got ${JSON.stringify(e.raw)}`);if(e.record_delimiter===void 0)e.record_delimiter=[];else if(typeof e.record_delimiter=="string"||N(e.record_delimiter)){if(e.record_delimiter.length===0)throw new m("CSV_INVALID_OPTION_RECORD_DELIMITER",["Invalid option `record_delimiter`:","value must be a non empty string or buffer,",`got ${JSON.stringify(e.record_delimiter)}`],e);e.record_delimiter=[e.record_delimiter]}else if(!Array.isArray(e.record_delimiter))throw new m("CSV_INVALID_OPTION_RECORD_DELIMITER",["Invalid option `record_delimiter`:","value must be a string, a buffer or array of string|buffer,",`got ${JSON.stringify(e.record_delimiter)}`],e);if(e.record_delimiter=e.record_delimiter.map(function(i,n){if(typeof i!="string"&&!N(i))throw new m("CSV_INVALID_OPTION_RECORD_DELIMITER",["Invalid option `record_delimiter`:","value must be a string, a buffer or array of string|buffer",`at index ${n},`,`got ${JSON.stringify(i)}`],e);if(i.length===0)throw new m("CSV_INVALID_OPTION_RECORD_DELIMITER",["Invalid option `record_delimiter`:","value must be a non empty string or buffer",`at index ${n},`,`got ${JSON.stringify(i)}`],e);return typeof i=="string"&&(i=f.from(i,e.encoding)),i}),typeof e.relax_column_count!="boolean")if(e.relax_column_count===void 0||e.relax_column_count===null)e.relax_column_count=!1;else throw new Error(`Invalid Option: relax_column_count must be a boolean, got ${JSON.stringify(e.relax_column_count)}`);if(typeof e.relax_column_count_less!="boolean")if(e.relax_column_count_less===void 0||e.relax_column_count_less===null)e.relax_column_count_less=!1;else throw new Error(`Invalid Option: relax_column_count_less must be a boolean, got ${JSON.stringify(e.relax_column_count_less)}`);if(typeof e.relax_column_count_more!="boolean")if(e.relax_column_count_more===void 0||e.relax_column_count_more===null)e.relax_column_count_more=!1;else throw new Error(`Invalid Option: relax_column_count_more must be a boolean, got ${JSON.stringify(e.relax_column_count_more)}`);if(typeof e.relax_quotes!="boolean")if(e.relax_quotes===void 0||e.relax_quotes===null)e.relax_quotes=!1;else throw new Error(`Invalid Option: relax_quotes must be a boolean, got ${JSON.stringify(e.relax_quotes)}`);if(typeof e.skip_empty_lines!="boolean")if(e.skip_empty_lines===void 0||e.skip_empty_lines===null)e.skip_empty_lines=!1;else throw new Error(`Invalid Option: skip_empty_lines must be a boolean, got ${JSON.stringify(e.skip_empty_lines)}`);if(typeof e.skip_records_with_empty_values!="boolean")if(e.skip_records_with_empty_values===void 0||e.skip_records_with_empty_values===null)e.skip_records_with_empty_values=!1;else throw new Error(`Invalid Option: skip_records_with_empty_values must be a boolean, got ${JSON.stringify(e.skip_records_with_empty_values)}`);if(typeof e.skip_records_with_error!="boolean")if(e.skip_records_with_error===void 0||e.skip_records_with_error===null)e.skip_records_with_error=!1;else throw new Error(`Invalid Option: skip_records_with_error must be a boolean, got ${JSON.stringify(e.skip_records_with_error)}`);if(e.rtrim===void 0||e.rtrim===null||e.rtrim===!1)e.rtrim=!1;else if(e.rtrim!==!0)throw new Error(`Invalid Option: rtrim must be a boolean, got ${JSON.stringify(e.rtrim)}`);if(e.ltrim===void 0||e.ltrim===null||e.ltrim===!1)e.ltrim=!1;else if(e.ltrim!==!0)throw new Error(`Invalid Option: ltrim must be a boolean, got ${JSON.stringify(e.ltrim)}`);if(e.trim===void 0||e.trim===null||e.trim===!1)e.trim=!1;else if(e.trim!==!0)throw new Error(`Invalid Option: trim must be a boolean, got ${JSON.stringify(e.trim)}`);if(e.trim===!0&&r.ltrim!==!1?e.ltrim=!0:e.ltrim!==!0&&(e.ltrim=!1),e.trim===!0&&r.rtrim!==!1?e.rtrim=!0:e.rtrim!==!0&&(e.rtrim=!1),e.to===void 0||e.to===null)e.to=-1;else if(e.to!==-1)if(typeof e.to=="string"&&/\d+/.test(e.to)&&(e.to=parseInt(e.to)),Number.isInteger(e.to)){if(e.to<=0)throw new Error(`Invalid Option: to must be a positive integer greater than 0, got ${JSON.stringify(r.to)}`)}else throw new Error(`Invalid Option: to must be an integer, got ${JSON.stringify(r.to)}`);if(e.to_line===void 0||e.to_line===null)e.to_line=-1;else if(e.to_line!==-1)if(typeof e.to_line=="string"&&/\d+/.test(e.to_line)&&(e.to_line=parseInt(e.to_line)),Number.isInteger(e.to_line)){if(e.to_line<=0)throw new Error(`Invalid Option: to_line must be a positive integer greater than 0, got ${JSON.stringify(r.to_line)}`)}else throw new Error(`Invalid Option: to_line must be an integer, got ${JSON.stringify(r.to_line)}`);return e},ue=function(r){return r.every(e=>e==null||e.toString&&e.toString().trim()==="")},ht=13,_t=10,P={utf8:f.from([239,187,191]),utf16le:f.from([255,254])},mt=function(r={}){const e={bytes:0,comment_lines:0,empty_lines:0,invalid_field_length:0,lines:1,records:0},t=le(r);return{info:e,original_options:r,options:t,state:at(t),__needMoreData:function(i,n,s){if(s)return!1;const{encoding:o,escape:l,quote:u}=this.options,{quoting:a,needMoreDataSize:h,recordDelimiterMaxLength:c}=this.state,w=n-i-1,y=Math.max(h,c===0?f.from(`\r
|
|
2
|
-
`,o).length:c,a?(l===null?0:l.length)+u.length:0,a?u.length+c:0);return w<y},parse:function(i,n,s,o){const{bom:l,comment_no_infix:u,encoding:a,from_line:h,ltrim:c,max_record_size:w,raw:y,relax_quotes:F,rtrim:x,skip_empty_lines:U,to:R,to_line:g}=this.options;let{comment:d,escape:b,quote:T,record_delimiter:W}=this.options;const{bomSkipped:be,previousBuf:V,rawBuffer:Ae,escapeIsQuote:Oe}=this.state;let p;if(V===void 0)if(i===void 0){o();return}else p=i;else V!==void 0&&i===void 0?p=V:p=f.concat([V,i]);if(be===!1)if(l===!1)this.state.bomSkipped=!0;else if(p.length<3){if(n===!1){this.state.previousBuf=p;return}}else{for(const I in P)if(P[I].compare(p,0,P[I].length)===0){const L=P[I].length;this.state.bufBytesStart+=L,p=p.slice(L);const J=le({...this.original_options,encoding:I});for(const E in J)this.options[E]=J[E];({comment:d,escape:b,quote:T}=this.options);break}this.state.bomSkipped=!0}const X=p.length;let _;for(_=0;_<X&&!this.__needMoreData(_,X,n);_++){if(this.state.wasRowDelimiter===!0&&(this.info.lines++,this.state.wasRowDelimiter=!1),g!==-1&&this.info.lines>g){this.state.stop=!0,o();return}this.state.quoting===!1&&W.length===0&&this.__autoDiscoverRecordDelimiter(p,_)&&(W=this.options.record_delimiter);const I=p[_];if(y===!0&&Ae.append(I),(I===ht||I===_t)&&this.state.wasRowDelimiter===!1&&(this.state.wasRowDelimiter=!0),this.state.escaping===!0)this.state.escaping=!1;else{if(b!==null&&this.state.quoting===!0&&this.__isEscape(p,_,I)&&_+b.length<X)if(Oe){if(this.__isQuote(p,_+b.length)){this.state.escaping=!0,_+=b.length-1;continue}}else{this.state.escaping=!0,_+=b.length-1;continue}if(this.state.commenting===!1&&this.__isQuote(p,_))if(this.state.quoting===!0){const E=p[_+T.length],M=x&&this.__isCharTrimable(p,_+T.length),v=d!==null&&this.__compareBytes(d,p,_+T.length,E),k=this.__isDelimiter(p,_+T.length,E),Y=W.length===0?this.__autoDiscoverRecordDelimiter(p,_+T.length):this.__isRecordDelimiter(E,p,_+T.length);if(b!==null&&this.__isEscape(p,_,I)&&this.__isQuote(p,_+b.length))_+=b.length-1;else if(!E||k||Y||v||M){this.state.quoting=!1,this.state.wasQuoting=!0,_+=T.length-1;continue}else if(F===!1){const re=this.__error(new m("CSV_INVALID_CLOSING_QUOTE",["Invalid Closing Quote:",`got "${String.fromCharCode(E)}"`,`at line ${this.info.lines}`,"instead of delimiter, record delimiter, trimable character","(if activated) or comment"],this.options,this.__infoField()));if(re!==void 0)return re}else this.state.quoting=!1,this.state.wasQuoting=!0,this.state.field.prepend(T),_+=T.length-1}else if(this.state.field.length!==0){if(F===!1){const E=this.__infoField(),M=Object.keys(P).map(k=>P[k].equals(this.state.field.toString())?k:!1).filter(Boolean)[0],v=this.__error(new m("INVALID_OPENING_QUOTE",["Invalid Opening Quote:",`a quote is found on field ${JSON.stringify(E.column)} at line ${E.lines}, value is ${JSON.stringify(this.state.field.toString(a))}`,M?`(${M} bom)`:void 0],this.options,E,{field:this.state.field}));if(v!==void 0)return v}}else{this.state.quoting=!0,_+=T.length-1;continue}if(this.state.quoting===!1){const E=this.__isRecordDelimiter(I,p,_);if(E!==0){if(this.state.commenting&&this.state.wasQuoting===!1&&this.state.record.length===0&&this.state.field.length===0)this.info.comment_lines++;else{if(this.state.enabled===!1&&this.info.lines+(this.state.wasRowDelimiter===!0?1:0)>=h){this.state.enabled=!0,this.__resetField(),this.__resetRecord(),_+=E-1;continue}if(U===!0&&this.state.wasQuoting===!1&&this.state.record.length===0&&this.state.field.length===0){this.info.empty_lines++,_+=E-1;continue}this.info.bytes=this.state.bufBytesStart+_;const k=this.__onField();if(k!==void 0)return k;this.info.bytes=this.state.bufBytesStart+_+E;const Y=this.__onRecord(s);if(Y!==void 0)return Y;if(R!==-1&&this.info.records>=R){this.state.stop=!0,o();return}}this.state.commenting=!1,_+=E-1;continue}if(this.state.commenting)continue;if(d!==null&&(u===!1||this.state.record.length===0&&this.state.field.length===0)&&this.__compareBytes(d,p,_,I)!==0){this.state.commenting=!0;continue}const M=this.__isDelimiter(p,_,I);if(M!==0){this.info.bytes=this.state.bufBytesStart+_;const v=this.__onField();if(v!==void 0)return v;_+=M-1;continue}}}if(this.state.commenting===!1&&w!==0&&this.state.record_length+this.state.field.length>w)return this.__error(new m("CSV_MAX_RECORD_SIZE",["Max Record Size:","record exceed the maximum number of tolerated bytes",`of ${w}`,`at line ${this.info.lines}`],this.options,this.__infoField()));const L=c===!1||this.state.quoting===!0||this.state.field.length!==0||!this.__isCharTrimable(p,_),J=x===!1||this.state.wasQuoting===!1;if(L===!0&&J===!0)this.state.field.append(I);else{if(x===!0&&!this.__isCharTrimable(p,_))return this.__error(new m("CSV_NON_TRIMABLE_CHAR_AFTER_CLOSING_QUOTE",["Invalid Closing Quote:","found non trimable byte after quote",`at line ${this.info.lines}`],this.options,this.__infoField()));L===!1&&(_+=this.__isCharTrimable(p,_)-1);continue}}if(n===!0)if(this.state.quoting===!0){const I=this.__error(new m("CSV_QUOTE_NOT_CLOSED",["Quote Not Closed:",`the parsing is finished with an opening quote at line ${this.info.lines}`],this.options,this.__infoField()));if(I!==void 0)return I}else if(this.state.wasQuoting===!0||this.state.record.length!==0||this.state.field.length!==0){this.info.bytes=this.state.bufBytesStart+_;const I=this.__onField();if(I!==void 0)return I;const L=this.__onRecord(s);if(L!==void 0)return L}else this.state.wasRowDelimiter===!0?this.info.empty_lines++:this.state.commenting===!0&&this.info.comment_lines++;else this.state.bufBytesStart+=_,this.state.previousBuf=p.slice(_);this.state.wasRowDelimiter===!0&&(this.info.lines++,this.state.wasRowDelimiter=!1)},__onRecord:function(i){const{columns:n,group_columns_by_name:s,encoding:o,info:l,from:u,relax_column_count:a,relax_column_count_less:h,relax_column_count_more:c,raw:w,skip_records_with_empty_values:y}=this.options,{enabled:F,record:x}=this.state;if(F===!1)return this.__resetRecord();const U=x.length;if(n===!0){if(y===!0&&ue(x)){this.__resetRecord();return}return this.__firstLineToColumns(x)}if(n===!1&&this.info.records===0&&(this.state.expectedRecordLength=U),U!==this.state.expectedRecordLength){const R=n===!1?new m("CSV_RECORD_INCONSISTENT_FIELDS_LENGTH",["Invalid Record Length:",`expect ${this.state.expectedRecordLength},`,`got ${U} on line ${this.info.lines}`],this.options,this.__infoField(),{record:x}):new m("CSV_RECORD_INCONSISTENT_COLUMNS",["Invalid Record Length:",`columns length is ${n.length},`,`got ${U} on line ${this.info.lines}`],this.options,this.__infoField(),{record:x});if(a===!0||h===!0&&U<this.state.expectedRecordLength||c===!0&&U>this.state.expectedRecordLength)this.info.invalid_field_length++,this.state.error=R;else{const g=this.__error(R);if(g)return g}}if(y===!0&&ue(x)){this.__resetRecord();return}if(this.state.recordHasError===!0){this.__resetRecord(),this.state.recordHasError=!1;return}if(this.info.records++,u===1||this.info.records>=u){const{objname:R}=this.options;if(n!==!1){const g={};for(let d=0,b=x.length;d<b;d++)n[d]===void 0||n[d].disabled||(s===!0&&g[n[d].name]!==void 0?Array.isArray(g[n[d].name])?g[n[d].name]=g[n[d].name].concat(x[d]):g[n[d].name]=[g[n[d].name],x[d]]:g[n[d].name]=x[d]);if(w===!0||l===!0){const d=Object.assign({record:g},w===!0?{raw:this.state.rawBuffer.toString(o)}:{},l===!0?{info:this.__infoRecord()}:{}),b=this.__push(R===void 0?d:[g[R],d],i);if(b)return b}else{const d=this.__push(R===void 0?g:[g[R],g],i);if(d)return d}}else if(w===!0||l===!0){const g=Object.assign({record:x},w===!0?{raw:this.state.rawBuffer.toString(o)}:{},l===!0?{info:this.__infoRecord()}:{}),d=this.__push(R===void 0?g:[x[R],g],i);if(d)return d}else{const g=this.__push(R===void 0?x:[x[R],x],i);if(g)return g}}this.__resetRecord()},__firstLineToColumns:function(i){const{firstLineToHeaders:n}=this.state;try{const s=n===void 0?i:n.call(null,i);if(!Array.isArray(s))return this.__error(new m("CSV_INVALID_COLUMN_MAPPING",["Invalid Column Mapping:","expect an array from column function,",`got ${JSON.stringify(s)}`],this.options,this.__infoField(),{headers:s}));const o=Re(s);this.state.expectedRecordLength=o.length,this.options.columns=o,this.__resetRecord();return}catch(s){return s}},__resetRecord:function(){this.options.raw===!0&&this.state.rawBuffer.reset(),this.state.error=void 0,this.state.record=[],this.state.record_length=0},__onField:function(){const{cast:i,encoding:n,rtrim:s,max_record_size:o}=this.options,{enabled:l,wasQuoting:u}=this.state;if(l===!1)return this.__resetField();let a=this.state.field.toString(n);if(s===!0&&u===!1&&(a=a.trimRight()),i===!0){const[h,c]=this.__cast(a);if(h!==void 0)return h;a=c}this.state.record.push(a),o!==0&&typeof a=="string"&&(this.state.record_length+=a.length),this.__resetField()},__resetField:function(){this.state.field.reset(),this.state.wasQuoting=!1},__push:function(i,n){const{on_record:s}=this.options;if(s!==void 0){const o=this.__infoRecord();try{i=s.call(null,i,o)}catch(l){return l}if(i==null)return}n(i)},__cast:function(i){const{columns:n,relax_column_count:s}=this.options;if(Array.isArray(n)===!0&&s&&this.options.columns.length<=this.state.record.length)return[void 0,void 0];if(this.state.castField!==null)try{const l=this.__infoField();return[void 0,this.state.castField.call(null,i,l)]}catch(l){return[l]}if(this.__isFloat(i))return[void 0,parseFloat(i)];if(this.options.cast_date!==!1){const l=this.__infoField();return[void 0,this.options.cast_date.call(null,i,l)]}return[void 0,i]},__isCharTrimable:function(i,n){return((o,l)=>{const{timchars:u}=this.state;e:for(let a=0;a<u.length;a++){const h=u[a];for(let c=0;c<h.length;c++)if(h[c]!==o[l+c])continue e;return h.length}return 0})(i,n)},__isFloat:function(i){return i-parseFloat(i)+1>=0},__compareBytes:function(i,n,s,o){if(i[0]!==o)return 0;const l=i.length;for(let u=1;u<l;u++)if(i[u]!==n[s+u])return 0;return l},__isDelimiter:function(i,n,s){const{delimiter:o,ignore_last_delimiters:l}=this.options;if(l===!0&&this.state.record.length===this.options.columns.length-1)return 0;if(l!==!1&&typeof l=="number"&&this.state.record.length===l-1)return 0;e:for(let u=0;u<o.length;u++){const a=o[u];if(a[0]===s){for(let h=1;h<a.length;h++)if(a[h]!==i[n+h])continue e;return a.length}}return 0},__isRecordDelimiter:function(i,n,s){const{record_delimiter:o}=this.options,l=o.length;e:for(let u=0;u<l;u++){const a=o[u],h=a.length;if(a[0]===i){for(let c=1;c<h;c++)if(a[c]!==n[s+c])continue e;return a.length}}return 0},__isEscape:function(i,n,s){const{escape:o}=this.options;if(o===null)return!1;const l=o.length;if(o[0]===s){for(let u=0;u<l;u++)if(o[u]!==i[n+u])return!1;return!0}return!1},__isQuote:function(i,n){const{quote:s}=this.options;if(s===null)return!1;const o=s.length;for(let l=0;l<o;l++)if(s[l]!==i[n+l])return!1;return!0},__autoDiscoverRecordDelimiter:function(i,n){const{encoding:s}=this.options,o=[f.from(`\r
|
|
3
|
-
`,s),f.from(`
|
|
4
|
-
`,s),f.from("\r",s)];e:for(let l=0;l<o.length;l++){const u=o[l].length;for(let a=0;a<u;a++)if(o[l][a]!==i[n+a])continue e;return this.options.record_delimiter.push(o[l]),this.state.recordDelimiterMaxLength=o[l].length,o[l].length}return 0},__error:function(i){const{encoding:n,raw:s,skip_records_with_error:o}=this.options,l=typeof i=="string"?new Error(i):i;if(o){if(this.state.recordHasError=!0,this.options.on_skip!==void 0)try{this.options.on_skip(l,s?this.state.rawBuffer.toString(n):void 0)}catch(u){return u}return}else return l},__infoDataSet:function(){return{...this.info,columns:this.options.columns}},__infoRecord:function(){const{columns:i,raw:n,encoding:s}=this.options;return{...this.__infoDataSet(),error:this.state.error,header:i===!0,index:this.state.record.length,raw:n?this.state.rawBuffer.toString(s):void 0}},__infoField:function(){const{columns:i}=this.options,n=Array.isArray(i);return{...this.__infoRecord(),column:n===!0?i.length>this.state.record.length?i[this.state.record.length].name:null:this.state.record.length,quoting:this.state.wasQuoting}}}},dt=function(r,e={}){typeof r=="string"&&(r=f.from(r));const t=e&&e.objname?{}:[],i=mt(e),n=l=>{i.options.objname===void 0?t.push(l):t[l[0]]=l[1]},s=()=>{},o=i.parse(r,!0,n,s);if(o!==void 0)throw o;return t};export{m as CsvError,dt as parse};
|