@qwen-code/qwen-code 0.19.6-nightly.20260707.bcdb44c5d → 0.19.6-preview.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundled/qc-helper/docs/features/channels/_meta.ts +1 -0
- package/bundled/qc-helper/docs/features/channels/overview.md +17 -9
- package/bundled/qc-helper/docs/features/channels/wecom.md +111 -0
- package/bundled/qc-helper/docs/features/code-review.md +0 -4
- package/bundled/review/DESIGN.md +0 -4
- package/bundled/review/SKILL.md +2 -29
- package/chunks/{MaxSizedBox-EFDCCPYQ.js → MaxSizedBox-2JOX4MMR.js} +11 -9
- package/chunks/{StandaloneSessionPicker-5TQG34MY.js → StandaloneSessionPicker-Z2G37ETA.js} +24 -21
- package/chunks/{acpAgent-KQT52XWB.js → acpAgent-MQJT2H4Y.js} +74 -49
- package/chunks/{agent-RL2YOM2V.js → agent-HEVJ76EO.js} +6 -6
- package/chunks/{agent-headless-SCVFLRZ3.js → agent-headless-UNB5SWYC.js} +6 -6
- package/chunks/{anthropicContentGenerator-PPPLABT5.js → anthropicContentGenerator-AKYPSZIV.js} +3 -3
- package/chunks/{artifact-tool-H2TNPNP5.js → artifact-tool-D233YJFH.js} +25 -6
- package/chunks/{bridge-G3LFYH2D.js → bridge-GX2LGQDS.js} +11 -9
- package/chunks/{channel-worker-supervisor-B7MSMB5K.js → channel-worker-supervisor-CRCVYQIE.js} +1 -1
- package/chunks/{chunk-XUYYEFCM.js → chunk-27QGW3BK.js} +5 -5
- package/chunks/{chunk-HLJMZYTD.js → chunk-2D5Q33PT.js} +3 -3
- package/chunks/{chunk-TNIZ2HCQ.js → chunk-2MDHTI6A.js} +2 -2
- package/chunks/{chunk-VCKMHAEZ.js → chunk-2MJAXDFK.js} +6 -6
- package/chunks/{chunk-WSVZFWN4.js → chunk-2NPS2UDH.js} +305 -97
- package/chunks/{chunk-WAVK7GV6.js → chunk-2X3ZVAAT.js} +2 -2
- package/chunks/chunk-332PWN27.js +19 -0
- package/chunks/{chunk-FVMWEHWU.js → chunk-3B26UVCX.js} +114 -12
- package/chunks/{chunk-XZ2LJL4O.js → chunk-43W4YSO6.js} +1 -12
- package/chunks/{chunk-DLHOIROF.js → chunk-44NROQYV.js} +4 -2
- package/chunks/{chunk-65P5ZXUE.js → chunk-4XV2MRNK.js} +1 -1
- package/chunks/{chunk-DS6NG7SB.js → chunk-5HMMLTUD.js} +11 -11
- package/chunks/{chunk-A2CS67WK.js → chunk-5IGNZP2J.js} +1 -1
- package/chunks/{chunk-N7BUPX4V.js → chunk-6GHEZDDX.js} +1 -1
- package/chunks/{chunk-QU6OLW25.js → chunk-7O6DD2ES.js} +1 -1
- package/chunks/{chunk-RXDYWLOG.js → chunk-7R62CLMI.js} +4 -4
- package/chunks/{chunk-2BJWUJCW.js → chunk-7SAH6M3Y.js} +3 -3
- package/chunks/{chunk-OGAC66WF.js → chunk-7VCI24VZ.js} +4 -107
- package/chunks/chunk-A2X3KLC3.js +3807 -0
- package/chunks/chunk-A3ZQMFO6.js +949 -0
- package/chunks/{chunk-AY7CP32Q.js → chunk-A7UKINBT.js} +7 -7
- package/chunks/{chunk-72DDO73Z.js → chunk-ADO6IDOZ.js} +8 -8
- package/chunks/{chunk-UOGOM4NJ.js → chunk-AJ3CEJRJ.js} +10 -5
- package/chunks/{chunk-NCFY7PWS.js → chunk-CCGOFQV3.js} +51 -2
- package/chunks/{chunk-YFE4YEDW.js → chunk-DB7CZERZ.js} +1 -1
- package/chunks/{chunk-UECJ7AG2.js → chunk-DF74IL3R.js} +4 -4
- package/chunks/{chunk-7YLLBKDB.js → chunk-FCEHOKYP.js} +5 -5
- package/chunks/{chunk-JO6RDLLE.js → chunk-FRR5I3SQ.js} +1 -1
- package/chunks/{chunk-2NL7ED5Q.js → chunk-FV7425LN.js} +22 -1
- package/chunks/{chunk-NCOLCOA6.js → chunk-GPLKAQUX.js} +8 -8
- package/chunks/{chunk-AKGA72ZM.js → chunk-GV2S4F6Q.js} +5 -3
- package/chunks/{chunk-V63Q7BVE.js → chunk-GW67O5SO.js} +1 -1
- package/chunks/{chunk-2A6XOMBQ.js → chunk-HW4N45EE.js} +0 -44
- package/chunks/{chunk-S6PM5JQZ.js → chunk-IFDJAMJW.js} +484 -1222
- package/chunks/{chunk-B2FUQ22Z.js → chunk-ILFQAFWH.js} +1 -1
- package/chunks/chunk-JYFZFWSL.js +167 -0
- package/chunks/{chunk-CA373SPN.js → chunk-K56RTEBN.js} +1 -1
- package/chunks/chunk-LGFAYIKX.js +115 -0
- package/chunks/{chunk-6JESGXWU.js → chunk-LLTFLVFK.js} +4 -4
- package/chunks/{chunk-3A4MUHRP.js → chunk-MZWODTEA.js} +5 -13
- package/chunks/{chunk-IPKM25FZ.js → chunk-N33JAGJ7.js} +505 -62
- package/chunks/{chunk-B2NCNYBK.js → chunk-NVQVIJMO.js} +112 -42
- package/chunks/{chunk-INNPK6XG.js → chunk-O6T7PBUM.js} +30 -6
- package/chunks/{chunk-RN36CE4M.js → chunk-P452E6XF.js} +2 -2
- package/chunks/chunk-PS2NG7KU.js +262 -0
- package/chunks/{chunk-FTEFJT6V.js → chunk-QM4FKX7H.js} +2 -2
- package/chunks/chunk-RODQXLGZ.js +28 -0
- package/chunks/{chunk-KSPVDFE4.js → chunk-SAIILPQ3.js} +0 -3
- package/chunks/{chunk-EKDTGEX4.js → chunk-SJ3QRPN2.js} +14 -8
- package/chunks/{chunk-R57UD732.js → chunk-SKO6VJHG.js} +16 -4
- package/chunks/{chunk-66KNL43D.js → chunk-TBAZMRW3.js} +1 -1
- package/chunks/{chunk-H2UZO2II.js → chunk-TPTG52XG.js} +1 -1
- package/chunks/chunk-UIDXQNMV.js +13 -0
- package/chunks/chunk-VP2FB7OC.js +8223 -0
- package/chunks/{chunk-32KIF557.js → chunk-WKBA74DD.js} +1 -1
- package/chunks/{chunk-IEFMDFCG.js → chunk-WKTLDGD6.js} +1 -1
- package/chunks/{chunk-HT553O4R.js → chunk-WRLMLPWI.js} +3 -3
- package/chunks/{chunk-CYXPEKVN.js → chunk-XXICIIS5.js} +5 -5
- package/chunks/{chunk-5GSUPP7K.js → chunk-Y3QQV7WE.js} +2 -2
- package/chunks/{chunk-CKBRK552.js → chunk-ZKX7IBXU.js} +4 -4
- package/chunks/{chunk-CCPKBMZ4.js → chunk-ZOSL7K3L.js} +203 -38
- package/chunks/{chunk-KD4KV6XW.js → chunk-ZWFS7YCB.js} +4505 -3850
- package/chunks/{computer-use-NKJX6RTG.js → computer-use-IQ46C3YP.js} +6 -6
- package/chunks/{contextCommand-BCABFW4A.js → contextCommand-TTT6AP2W.js} +10 -9
- package/chunks/{cron-create-DDYU4DIR.js → cron-create-JSXEIPVS.js} +1 -1
- package/chunks/{cron-delete-DFKOUZWN.js → cron-delete-OIFVEPGU.js} +1 -1
- package/chunks/{cron-list-ME5QGAR5.js → cron-list-D4ZX4IOE.js} +1 -1
- package/chunks/{daemon-XWG2EGFX.js → daemon-F3I2RXP6.js} +23 -3
- package/chunks/{daemon-status-provider-V7BMA4EH.js → daemon-status-provider-5GAWK65R.js} +13 -12
- package/chunks/dist-573HNSVO.js +3217 -0
- package/chunks/{dist-VHBP2PIG.js → dist-FQ5WRJPL.js} +2 -2
- package/chunks/{dist-LPVU3L2M.js → dist-IMFFBMAT.js} +6 -3792
- package/chunks/{dist-7GU63KI5.js → dist-OT7G2WNM.js} +1 -1
- package/chunks/{dist-H4HHZYCI.js → dist-PKFTNUHO.js} +2 -2
- package/chunks/{dist-3UDX5T4T.js → dist-YTRKAVUB.js} +1 -1
- package/chunks/{earlyInputCapture-TVECMHWI.js → earlyInputCapture-LAGZUGGV.js} +6 -6
- package/chunks/{edit-VKUCEX2N.js → edit-Q5BUQC2S.js} +6 -6
- package/chunks/{en-AXARKOWO.js → en-GA2RMXY5.js} +5 -1
- package/chunks/{enter-worktree-TF6N7GA7.js → enter-worktree-DC4FHMVF.js} +6 -6
- package/chunks/{enterPlanMode-XXQGZP5T.js → enterPlanMode-5BGJBWIY.js} +6 -6
- package/chunks/{errors-LLC2B5D6.js → errors-EGX5DECS.js} +8 -8
- package/chunks/{exit-worktree-YBOMMZLI.js → exit-worktree-2EOSZNZI.js} +6 -6
- package/chunks/{exitPlanMode-74D7EOBH.js → exitPlanMode-JAQ35ELJ.js} +6 -6
- package/chunks/{fast-path-OGY4P74O.js → fast-path-QEWDA6O6.js} +5 -2
- package/chunks/{fr-MBMNQSQ6.js → fr-GWNQG4XH.js} +4 -0
- package/chunks/{gemini-IL6H4VNW.js → gemini-TQ5XANRS.js} +64 -187
- package/chunks/{geminiContentGenerator-O7OCAUQU.js → geminiContentGenerator-DCM2XGDQ.js} +1 -1
- package/chunks/{glob-X5XFJTAC.js → glob-7JLTQ4IQ.js} +6 -6
- package/chunks/{grep-53GLRSNS.js → grep-CAUXEO7Q.js} +6 -6
- package/chunks/handleAutoUpdate-XKXULZQX.js +65 -0
- package/chunks/{initializer-YBUEYP6D.js → initializer-3NRWU5JV.js} +12 -10
- package/chunks/{ja-HFV5QCHR.js → ja-2HOTA47X.js} +4 -0
- package/chunks/{list-2F3FSN46.js → list-NWO6QBDQ.js} +12 -12
- package/chunks/{loadedSettingsAdapter-AJBE627U.js → loadedSettingsAdapter-PJ77LGFS.js} +10 -10
- package/chunks/{loop-wakeup-ZW5P6VPY.js → loop-wakeup-OHWEMFP5.js} +2 -2
- package/chunks/{mcp-SEE2Z7TA.js → mcp-VFEHVF5A.js} +10 -10
- package/chunks/{monitor-YQW2M3DL.js → monitor-FY2ITVSC.js} +14 -9
- package/chunks/{nonInteractiveCli-TGWJDY47.js → nonInteractiveCli-KPCXTVWY.js} +41 -36
- package/chunks/{notebook-edit-O5G3EBYN.js → notebook-edit-BSJMXIWX.js} +6 -6
- package/chunks/{openaiContentGenerator-WAO7PPR6.js → openaiContentGenerator-BA6NWY4S.js} +5 -5
- package/chunks/{pidfile-XMDB2SF7.js → pidfile-WXMRN6QF.js} +6 -6
- package/chunks/{qwenContentGenerator-5NZ5EHRA.js → qwenContentGenerator-U4ZSLGFN.js} +8 -8
- package/chunks/{read-file-KJTMBLFF.js → read-file-VMVHNOMA.js} +2 -2
- package/chunks/{ripGrep-BCDYVQQR.js → ripGrep-NC6MUWXN.js} +6 -6
- package/chunks/{run-qwen-serve-LIWM3CMV.js → run-qwen-serve-NQH6LQTH.js} +124 -31
- package/chunks/{scheduler-VETDW3HX.js → scheduler-35T3E2UQ.js} +6 -6
- package/chunks/{serve-XKFTUZET.js → serve-C36LOB5N.js} +10 -10
- package/chunks/{server-W64GXOEJ.js → server-TDFPIDC3.js} +858 -105
- package/chunks/{session-GXNRZGVF.js → session-STHNQGRJ.js} +42 -37
- package/chunks/{settings-TIQCDHBZ.js → settings-GIE22AYF.js} +9 -9
- package/chunks/{shell-3ZZLLA35.js → shell-JD52AIMU.js} +6 -6
- package/chunks/{skill-TOX5QGBX.js → skill-L4IFKRQ5.js} +14 -4
- package/chunks/{spawnChannel-JBLAIP7L.js → spawnChannel-HGMOEPM7.js} +8 -8
- package/chunks/{src-Q7BIRWUP.js → src-3SNF3G3V.js} +15 -7
- package/chunks/{startInteractiveUI-PP72WI64.js → startInteractiveUI-C7DCDHGF.js} +4981 -13173
- package/chunks/{team-create-S44Z3N62.js → team-create-NYL7KAMA.js} +6 -6
- package/chunks/{team-plan-approval-2YPLSLO5.js → team-plan-approval-LH65JBEH.js} +6 -6
- package/chunks/{theme-manager-4MJVYHPB.js → theme-manager-ANKQO5DR.js} +6 -6
- package/chunks/{tool-search-4LSRQ24Z.js → tool-search-WZEGJFO4.js} +4 -21
- package/chunks/{trustedFolders-XMKLRQDH.js → trustedFolders-HECAG3S3.js} +7 -7
- package/chunks/updateCheck-72BBAE5V.js +65 -0
- package/chunks/{validateNonInterActiveAuth-MMMRF6WS.js → validateNonInterActiveAuth-PDQCPSNA.js} +38 -33
- package/chunks/{version-6HMEMR4K.js → version-VSEUTPNM.js} +2 -1
- package/chunks/{workflow-VYBLLOLC.js → workflow-DPF2CL7U.js} +7 -7
- package/chunks/{workspace-providers-status-5LSCQPWQ.js → workspace-providers-status-TQ23DQ2D.js} +12 -12
- package/chunks/{workspace-service-HBMBWJ4K.js → workspace-service-D34UDMEY.js} +14 -14
- package/chunks/{workspace-skills-status-TLBAQWKQ.js → workspace-skills-status-4DR5UNNC.js} +11 -11
- package/chunks/{write-file-QMAWLWCT.js → write-file-VFNAKGYM.js} +6 -6
- package/chunks/{zh-RS3HZHFH.js → zh-7XVVRTDH.js} +5 -1
- package/chunks/{zh-TW-L5GRQ4S4.js → zh-TW-DPH554OG.js} +5 -1
- package/cli.js +11 -11
- package/locales/en.js +8 -2
- package/locales/fr.js +6 -0
- package/locales/ja.js +6 -0
- package/locales/zh-TW.js +8 -2
- package/locales/zh.js +8 -2
- package/node_modules/@qwen-code/audio-capture/package.json +1 -1
- package/node_modules/@qwen-code/audio-capture/prebuilds/darwin-arm64/@qwen-code+audio-capture.node +0 -0
- package/node_modules/@qwen-code/audio-capture/prebuilds/darwin-x64/@qwen-code+audio-capture.node +0 -0
- package/node_modules/@qwen-code/audio-capture/prebuilds/win32-x64/@qwen-code+audio-capture.node +0 -0
- package/package.json +3 -3
- package/web-shell/assets/{arc-CqwzD3ok.js → arc-C7hjaa7g.js} +1 -1
- package/web-shell/assets/{architectureDiagram-3BPJPVTR-BfA-P0-O.js → architectureDiagram-3BPJPVTR-pm9KtMZY.js} +1 -1
- package/web-shell/assets/{blockDiagram-GPEHLZMM-DNTzkXRp.js → blockDiagram-GPEHLZMM-CApElKsU.js} +1 -1
- package/web-shell/assets/{c4Diagram-AAUBKEIU-D5axQoXQ.js → c4Diagram-AAUBKEIU-BeDe0-9N.js} +1 -1
- package/web-shell/assets/channel-BNf1dW-j.js +1 -0
- package/web-shell/assets/{chunk-2J33WTMH-CV0P48eN.js → chunk-2J33WTMH-DJEkmLdl.js} +1 -1
- package/web-shell/assets/{chunk-4BX2VUAB-CghJNPCS.js → chunk-4BX2VUAB-DXX8gdpe.js} +1 -1
- package/web-shell/assets/{chunk-55IACEB6-BrD-776x.js → chunk-55IACEB6-DORmk1kQ.js} +1 -1
- package/web-shell/assets/{chunk-727SXJPM-DLKkI5Yu.js → chunk-727SXJPM-DWmO4mCZ.js} +1 -1
- package/web-shell/assets/{chunk-AQP2D5EJ-C0HWhZNK.js → chunk-AQP2D5EJ-C7LRaYw2.js} +1 -1
- package/web-shell/assets/{chunk-FMBD7UC4-Cg6PsiNL.js → chunk-FMBD7UC4-CCdXgyC5.js} +1 -1
- package/web-shell/assets/{chunk-ND2GUHAM-B1pCuSlf.js → chunk-ND2GUHAM-SyL_xvWc.js} +1 -1
- package/web-shell/assets/{chunk-QZHKN3VN-CkE8llI2.js → chunk-QZHKN3VN-BzOuCKxa.js} +1 -1
- package/web-shell/assets/classDiagram-4FO5ZUOK-uOIGlzgi.js +1 -0
- package/web-shell/assets/classDiagram-v2-Q7XG4LA2-uOIGlzgi.js +1 -0
- package/web-shell/assets/{cose-bilkent-S5V4N54A-Btr-W-vN.js → cose-bilkent-S5V4N54A-BMPWyDKc.js} +1 -1
- package/web-shell/assets/{dagre-BM42HDAG-CAhjVa5L.js → dagre-BM42HDAG-B_GnPWik.js} +1 -1
- package/web-shell/assets/{diagram-2AECGRRQ-eUQodUXw.js → diagram-2AECGRRQ-fJqMc3S_.js} +1 -1
- package/web-shell/assets/{diagram-5GNKFQAL-BiPKbH6E.js → diagram-5GNKFQAL-ximV3O9D.js} +1 -1
- package/web-shell/assets/{diagram-KO2AKTUF-DxuwR-Pu.js → diagram-KO2AKTUF-2vVyjzqw.js} +1 -1
- package/web-shell/assets/{diagram-LMA3HP47-nz9SQ3Az.js → diagram-LMA3HP47-Dckcx1sT.js} +1 -1
- package/web-shell/assets/{diagram-OG6HWLK6-UBbYk-Jq.js → diagram-OG6HWLK6-BAVv47ga.js} +1 -1
- package/web-shell/assets/{erDiagram-TEJ5UH35-BLpRQmgi.js → erDiagram-TEJ5UH35-Bn3nf5J0.js} +1 -1
- package/web-shell/assets/{flowDiagram-I6XJVG4X-C5Qqg1hx.js → flowDiagram-I6XJVG4X-BIbGF9JT.js} +1 -1
- package/web-shell/assets/{ganttDiagram-6RSMTGT7-BMdf3kjL.js → ganttDiagram-6RSMTGT7-CDbhb3AH.js} +1 -1
- package/web-shell/assets/{gitGraphDiagram-PVQCEYII-D9qG7BKD.js → gitGraphDiagram-PVQCEYII-CbKG1a_w.js} +1 -1
- package/web-shell/assets/index-CnE2ur2L.js +779 -0
- package/web-shell/assets/index-hSKXrlSE.css +5 -0
- package/web-shell/assets/{infoDiagram-5YYISTIA-CtDBPJM8.js → infoDiagram-5YYISTIA-DUFxTy8m.js} +1 -1
- package/web-shell/assets/{ishikawaDiagram-YF4QCWOH-BQaS7H3_.js → ishikawaDiagram-YF4QCWOH-D69hrBG8.js} +1 -1
- package/web-shell/assets/{journeyDiagram-JHISSGLW-CEEujCNX.js → journeyDiagram-JHISSGLW-DsvEw51Y.js} +1 -1
- package/web-shell/assets/{kanban-definition-UN3LZRKU-B3QqyyNi.js → kanban-definition-UN3LZRKU-lFFjZEYd.js} +1 -1
- package/web-shell/assets/{linear-DC2Azd_6.js → linear-Bo5bWzvo.js} +1 -1
- package/web-shell/assets/{mermaid.core-DL5PRmh-.js → mermaid.core-C_HKMJx5.js} +5 -5
- package/web-shell/assets/{mindmap-definition-RKZ34NQL-DGlkd_fb.js → mindmap-definition-RKZ34NQL-DlV-NUTs.js} +1 -1
- package/web-shell/assets/{pieDiagram-4H26LBE5-Dew4R8DT.js → pieDiagram-4H26LBE5-B2e6FH2a.js} +1 -1
- package/web-shell/assets/{quadrantDiagram-W4KKPZXB-Bk02Tejc.js → quadrantDiagram-W4KKPZXB-D75kSk-b.js} +1 -1
- package/web-shell/assets/{requirementDiagram-4Y6WPE33-BkWJE-6M.js → requirementDiagram-4Y6WPE33-CQ6xakhM.js} +1 -1
- package/web-shell/assets/{sankeyDiagram-5OEKKPKP-BM9bZAuM.js → sankeyDiagram-5OEKKPKP-J_XTKrcY.js} +1 -1
- package/web-shell/assets/{sequenceDiagram-3UESZ5HK-IaE2rOTu.js → sequenceDiagram-3UESZ5HK-D7jTcBtf.js} +1 -1
- package/web-shell/assets/{stateDiagram-AJRCARHV-CQH-ENFJ.js → stateDiagram-AJRCARHV-CrlM_OT3.js} +1 -1
- package/web-shell/assets/stateDiagram-v2-BHNVJYJU-Bs4TK_84.js +1 -0
- package/web-shell/assets/{timeline-definition-PNZ67QCA-DVH5FaeF.js → timeline-definition-PNZ67QCA-5oZi76Ef.js} +1 -1
- package/web-shell/assets/{vennDiagram-CIIHVFJN-ChT6J8JT.js → vennDiagram-CIIHVFJN-DO5YptPK.js} +1 -1
- package/web-shell/assets/{wardley-L42UT6IY-D9W5AEjE.js → wardley-L42UT6IY-4t1eJDvM.js} +1 -1
- package/web-shell/assets/{wardleyDiagram-YWT4CUSO-cNYKmuIA.js → wardleyDiagram-YWT4CUSO-DKZc661S.js} +1 -1
- package/web-shell/assets/{xychartDiagram-2RQKCTM6-BleLm4BJ.js → xychartDiagram-2RQKCTM6-su9hp08G.js} +1 -1
- package/web-shell/index.html +2 -2
- package/web-shell/assets/channel-EyH7BS8F.js +0 -1
- package/web-shell/assets/classDiagram-4FO5ZUOK-CPWvwYMM.js +0 -1
- package/web-shell/assets/classDiagram-v2-Q7XG4LA2-CPWvwYMM.js +0 -1
- package/web-shell/assets/index-CgttHpqB.js +0 -763
- package/web-shell/assets/index-sVELoa_9.css +0 -5
- package/web-shell/assets/stateDiagram-v2-BHNVJYJU-CFqBlFdE.js +0 -1
|
@@ -0,0 +1,3807 @@
|
|
|
1
|
+
// Force strict mode and setup for ESM
|
|
2
|
+
"use strict";
|
|
3
|
+
import {
|
|
4
|
+
require_follow_redirects,
|
|
5
|
+
require_form_data,
|
|
6
|
+
require_proxy_from_env
|
|
7
|
+
} from "./chunk-QXPI7FEC.js";
|
|
8
|
+
import {
|
|
9
|
+
require_extension,
|
|
10
|
+
require_permessage_deflate,
|
|
11
|
+
require_receiver,
|
|
12
|
+
require_sender,
|
|
13
|
+
require_stream,
|
|
14
|
+
require_subprotocol,
|
|
15
|
+
require_websocket,
|
|
16
|
+
require_websocket_server
|
|
17
|
+
} from "./chunk-5IFG2VC4.js";
|
|
18
|
+
import {
|
|
19
|
+
init_esbuild_shims
|
|
20
|
+
} from "./chunk-A4BMJM77.js";
|
|
21
|
+
import {
|
|
22
|
+
__commonJS,
|
|
23
|
+
__name,
|
|
24
|
+
__require
|
|
25
|
+
} from "./chunk-J2S4EL5Y.js";
|
|
26
|
+
|
|
27
|
+
// node_modules/axios/dist/node/axios.cjs
|
|
28
|
+
var require_axios = __commonJS({
|
|
29
|
+
"node_modules/axios/dist/node/axios.cjs"(exports, module) {
|
|
30
|
+
"use strict";
|
|
31
|
+
init_esbuild_shims();
|
|
32
|
+
var FormData$1 = require_form_data();
|
|
33
|
+
var crypto = __require("crypto");
|
|
34
|
+
var url = __require("url");
|
|
35
|
+
var proxyFromEnv = require_proxy_from_env();
|
|
36
|
+
var http = __require("http");
|
|
37
|
+
var https = __require("https");
|
|
38
|
+
var http2 = __require("http2");
|
|
39
|
+
var util = __require("util");
|
|
40
|
+
var followRedirects = require_follow_redirects();
|
|
41
|
+
var zlib = __require("zlib");
|
|
42
|
+
var stream = __require("stream");
|
|
43
|
+
var events = __require("events");
|
|
44
|
+
function _interopDefaultLegacy(e) {
|
|
45
|
+
return e && typeof e === "object" && "default" in e ? e : { "default": e };
|
|
46
|
+
}
|
|
47
|
+
__name(_interopDefaultLegacy, "_interopDefaultLegacy");
|
|
48
|
+
var FormData__default = /* @__PURE__ */ _interopDefaultLegacy(FormData$1);
|
|
49
|
+
var crypto__default = /* @__PURE__ */ _interopDefaultLegacy(crypto);
|
|
50
|
+
var url__default = /* @__PURE__ */ _interopDefaultLegacy(url);
|
|
51
|
+
var proxyFromEnv__default = /* @__PURE__ */ _interopDefaultLegacy(proxyFromEnv);
|
|
52
|
+
var http__default = /* @__PURE__ */ _interopDefaultLegacy(http);
|
|
53
|
+
var https__default = /* @__PURE__ */ _interopDefaultLegacy(https);
|
|
54
|
+
var http2__default = /* @__PURE__ */ _interopDefaultLegacy(http2);
|
|
55
|
+
var util__default = /* @__PURE__ */ _interopDefaultLegacy(util);
|
|
56
|
+
var followRedirects__default = /* @__PURE__ */ _interopDefaultLegacy(followRedirects);
|
|
57
|
+
var zlib__default = /* @__PURE__ */ _interopDefaultLegacy(zlib);
|
|
58
|
+
var stream__default = /* @__PURE__ */ _interopDefaultLegacy(stream);
|
|
59
|
+
function bind(fn, thisArg) {
|
|
60
|
+
return /* @__PURE__ */ __name(function wrap() {
|
|
61
|
+
return fn.apply(thisArg, arguments);
|
|
62
|
+
}, "wrap");
|
|
63
|
+
}
|
|
64
|
+
__name(bind, "bind");
|
|
65
|
+
var { toString } = Object.prototype;
|
|
66
|
+
var { getPrototypeOf } = Object;
|
|
67
|
+
var { iterator, toStringTag } = Symbol;
|
|
68
|
+
var kindOf = /* @__PURE__ */ ((cache) => (thing) => {
|
|
69
|
+
const str = toString.call(thing);
|
|
70
|
+
return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());
|
|
71
|
+
})(/* @__PURE__ */ Object.create(null));
|
|
72
|
+
var kindOfTest = /* @__PURE__ */ __name((type) => {
|
|
73
|
+
type = type.toLowerCase();
|
|
74
|
+
return (thing) => kindOf(thing) === type;
|
|
75
|
+
}, "kindOfTest");
|
|
76
|
+
var typeOfTest = /* @__PURE__ */ __name((type) => (thing) => typeof thing === type, "typeOfTest");
|
|
77
|
+
var { isArray } = Array;
|
|
78
|
+
var isUndefined = typeOfTest("undefined");
|
|
79
|
+
function isBuffer(val) {
|
|
80
|
+
return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) && isFunction$1(val.constructor.isBuffer) && val.constructor.isBuffer(val);
|
|
81
|
+
}
|
|
82
|
+
__name(isBuffer, "isBuffer");
|
|
83
|
+
var isArrayBuffer = kindOfTest("ArrayBuffer");
|
|
84
|
+
function isArrayBufferView(val) {
|
|
85
|
+
let result;
|
|
86
|
+
if (typeof ArrayBuffer !== "undefined" && ArrayBuffer.isView) {
|
|
87
|
+
result = ArrayBuffer.isView(val);
|
|
88
|
+
} else {
|
|
89
|
+
result = val && val.buffer && isArrayBuffer(val.buffer);
|
|
90
|
+
}
|
|
91
|
+
return result;
|
|
92
|
+
}
|
|
93
|
+
__name(isArrayBufferView, "isArrayBufferView");
|
|
94
|
+
var isString = typeOfTest("string");
|
|
95
|
+
var isFunction$1 = typeOfTest("function");
|
|
96
|
+
var isNumber = typeOfTest("number");
|
|
97
|
+
var isObject = /* @__PURE__ */ __name((thing) => thing !== null && typeof thing === "object", "isObject");
|
|
98
|
+
var isBoolean = /* @__PURE__ */ __name((thing) => thing === true || thing === false, "isBoolean");
|
|
99
|
+
var isPlainObject = /* @__PURE__ */ __name((val) => {
|
|
100
|
+
if (kindOf(val) !== "object") {
|
|
101
|
+
return false;
|
|
102
|
+
}
|
|
103
|
+
const prototype2 = getPrototypeOf(val);
|
|
104
|
+
return (prototype2 === null || prototype2 === Object.prototype || Object.getPrototypeOf(prototype2) === null) && !(toStringTag in val) && !(iterator in val);
|
|
105
|
+
}, "isPlainObject");
|
|
106
|
+
var isEmptyObject = /* @__PURE__ */ __name((val) => {
|
|
107
|
+
if (!isObject(val) || isBuffer(val)) {
|
|
108
|
+
return false;
|
|
109
|
+
}
|
|
110
|
+
try {
|
|
111
|
+
return Object.keys(val).length === 0 && Object.getPrototypeOf(val) === Object.prototype;
|
|
112
|
+
} catch (e) {
|
|
113
|
+
return false;
|
|
114
|
+
}
|
|
115
|
+
}, "isEmptyObject");
|
|
116
|
+
var isDate = kindOfTest("Date");
|
|
117
|
+
var isFile = kindOfTest("File");
|
|
118
|
+
var isReactNativeBlob = /* @__PURE__ */ __name((value) => {
|
|
119
|
+
return !!(value && typeof value.uri !== "undefined");
|
|
120
|
+
}, "isReactNativeBlob");
|
|
121
|
+
var isReactNative = /* @__PURE__ */ __name((formData) => formData && typeof formData.getParts !== "undefined", "isReactNative");
|
|
122
|
+
var isBlob = kindOfTest("Blob");
|
|
123
|
+
var isFileList = kindOfTest("FileList");
|
|
124
|
+
var isStream = /* @__PURE__ */ __name((val) => isObject(val) && isFunction$1(val.pipe), "isStream");
|
|
125
|
+
function getGlobal() {
|
|
126
|
+
if (typeof globalThis !== "undefined") return globalThis;
|
|
127
|
+
if (typeof self !== "undefined") return self;
|
|
128
|
+
if (typeof window !== "undefined") return window;
|
|
129
|
+
if (typeof globalThis !== "undefined") return globalThis;
|
|
130
|
+
return {};
|
|
131
|
+
}
|
|
132
|
+
__name(getGlobal, "getGlobal");
|
|
133
|
+
var G = getGlobal();
|
|
134
|
+
var FormDataCtor = typeof G.FormData !== "undefined" ? G.FormData : void 0;
|
|
135
|
+
var isFormData = /* @__PURE__ */ __name((thing) => {
|
|
136
|
+
let kind;
|
|
137
|
+
return thing && (FormDataCtor && thing instanceof FormDataCtor || isFunction$1(thing.append) && ((kind = kindOf(thing)) === "formdata" || // detect form-data instance
|
|
138
|
+
kind === "object" && isFunction$1(thing.toString) && thing.toString() === "[object FormData]"));
|
|
139
|
+
}, "isFormData");
|
|
140
|
+
var isURLSearchParams = kindOfTest("URLSearchParams");
|
|
141
|
+
var [isReadableStream, isRequest, isResponse, isHeaders] = [
|
|
142
|
+
"ReadableStream",
|
|
143
|
+
"Request",
|
|
144
|
+
"Response",
|
|
145
|
+
"Headers"
|
|
146
|
+
].map(kindOfTest);
|
|
147
|
+
var trim = /* @__PURE__ */ __name((str) => {
|
|
148
|
+
return str.trim ? str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
|
|
149
|
+
}, "trim");
|
|
150
|
+
function forEach(obj, fn, { allOwnKeys = false } = {}) {
|
|
151
|
+
if (obj === null || typeof obj === "undefined") {
|
|
152
|
+
return;
|
|
153
|
+
}
|
|
154
|
+
let i;
|
|
155
|
+
let l;
|
|
156
|
+
if (typeof obj !== "object") {
|
|
157
|
+
obj = [obj];
|
|
158
|
+
}
|
|
159
|
+
if (isArray(obj)) {
|
|
160
|
+
for (i = 0, l = obj.length; i < l; i++) {
|
|
161
|
+
fn.call(null, obj[i], i, obj);
|
|
162
|
+
}
|
|
163
|
+
} else {
|
|
164
|
+
if (isBuffer(obj)) {
|
|
165
|
+
return;
|
|
166
|
+
}
|
|
167
|
+
const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj);
|
|
168
|
+
const len = keys.length;
|
|
169
|
+
let key;
|
|
170
|
+
for (i = 0; i < len; i++) {
|
|
171
|
+
key = keys[i];
|
|
172
|
+
fn.call(null, obj[key], key, obj);
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
__name(forEach, "forEach");
|
|
177
|
+
function findKey(obj, key) {
|
|
178
|
+
if (isBuffer(obj)) {
|
|
179
|
+
return null;
|
|
180
|
+
}
|
|
181
|
+
key = key.toLowerCase();
|
|
182
|
+
const keys = Object.keys(obj);
|
|
183
|
+
let i = keys.length;
|
|
184
|
+
let _key;
|
|
185
|
+
while (i-- > 0) {
|
|
186
|
+
_key = keys[i];
|
|
187
|
+
if (key === _key.toLowerCase()) {
|
|
188
|
+
return _key;
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
return null;
|
|
192
|
+
}
|
|
193
|
+
__name(findKey, "findKey");
|
|
194
|
+
var _global = (() => {
|
|
195
|
+
if (typeof globalThis !== "undefined") return globalThis;
|
|
196
|
+
return typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : globalThis;
|
|
197
|
+
})();
|
|
198
|
+
var isContextDefined = /* @__PURE__ */ __name((context) => !isUndefined(context) && context !== _global, "isContextDefined");
|
|
199
|
+
function merge() {
|
|
200
|
+
const { caseless, skipUndefined } = isContextDefined(this) && this || {};
|
|
201
|
+
const result = {};
|
|
202
|
+
const assignValue = /* @__PURE__ */ __name((val, key) => {
|
|
203
|
+
if (key === "__proto__" || key === "constructor" || key === "prototype") {
|
|
204
|
+
return;
|
|
205
|
+
}
|
|
206
|
+
const targetKey = caseless && findKey(result, key) || key;
|
|
207
|
+
if (isPlainObject(result[targetKey]) && isPlainObject(val)) {
|
|
208
|
+
result[targetKey] = merge(result[targetKey], val);
|
|
209
|
+
} else if (isPlainObject(val)) {
|
|
210
|
+
result[targetKey] = merge({}, val);
|
|
211
|
+
} else if (isArray(val)) {
|
|
212
|
+
result[targetKey] = val.slice();
|
|
213
|
+
} else if (!skipUndefined || !isUndefined(val)) {
|
|
214
|
+
result[targetKey] = val;
|
|
215
|
+
}
|
|
216
|
+
}, "assignValue");
|
|
217
|
+
for (let i = 0, l = arguments.length; i < l; i++) {
|
|
218
|
+
arguments[i] && forEach(arguments[i], assignValue);
|
|
219
|
+
}
|
|
220
|
+
return result;
|
|
221
|
+
}
|
|
222
|
+
__name(merge, "merge");
|
|
223
|
+
var extend = /* @__PURE__ */ __name((a, b, thisArg, { allOwnKeys } = {}) => {
|
|
224
|
+
forEach(
|
|
225
|
+
b,
|
|
226
|
+
(val, key) => {
|
|
227
|
+
if (thisArg && isFunction$1(val)) {
|
|
228
|
+
Object.defineProperty(a, key, {
|
|
229
|
+
value: bind(val, thisArg),
|
|
230
|
+
writable: true,
|
|
231
|
+
enumerable: true,
|
|
232
|
+
configurable: true
|
|
233
|
+
});
|
|
234
|
+
} else {
|
|
235
|
+
Object.defineProperty(a, key, {
|
|
236
|
+
value: val,
|
|
237
|
+
writable: true,
|
|
238
|
+
enumerable: true,
|
|
239
|
+
configurable: true
|
|
240
|
+
});
|
|
241
|
+
}
|
|
242
|
+
},
|
|
243
|
+
{ allOwnKeys }
|
|
244
|
+
);
|
|
245
|
+
return a;
|
|
246
|
+
}, "extend");
|
|
247
|
+
var stripBOM = /* @__PURE__ */ __name((content) => {
|
|
248
|
+
if (content.charCodeAt(0) === 65279) {
|
|
249
|
+
content = content.slice(1);
|
|
250
|
+
}
|
|
251
|
+
return content;
|
|
252
|
+
}, "stripBOM");
|
|
253
|
+
var inherits = /* @__PURE__ */ __name((constructor, superConstructor, props, descriptors) => {
|
|
254
|
+
constructor.prototype = Object.create(superConstructor.prototype, descriptors);
|
|
255
|
+
Object.defineProperty(constructor.prototype, "constructor", {
|
|
256
|
+
value: constructor,
|
|
257
|
+
writable: true,
|
|
258
|
+
enumerable: false,
|
|
259
|
+
configurable: true
|
|
260
|
+
});
|
|
261
|
+
Object.defineProperty(constructor, "super", {
|
|
262
|
+
value: superConstructor.prototype
|
|
263
|
+
});
|
|
264
|
+
props && Object.assign(constructor.prototype, props);
|
|
265
|
+
}, "inherits");
|
|
266
|
+
var toFlatObject = /* @__PURE__ */ __name((sourceObj, destObj, filter, propFilter) => {
|
|
267
|
+
let props;
|
|
268
|
+
let i;
|
|
269
|
+
let prop;
|
|
270
|
+
const merged = {};
|
|
271
|
+
destObj = destObj || {};
|
|
272
|
+
if (sourceObj == null) return destObj;
|
|
273
|
+
do {
|
|
274
|
+
props = Object.getOwnPropertyNames(sourceObj);
|
|
275
|
+
i = props.length;
|
|
276
|
+
while (i-- > 0) {
|
|
277
|
+
prop = props[i];
|
|
278
|
+
if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) {
|
|
279
|
+
destObj[prop] = sourceObj[prop];
|
|
280
|
+
merged[prop] = true;
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
sourceObj = filter !== false && getPrototypeOf(sourceObj);
|
|
284
|
+
} while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype);
|
|
285
|
+
return destObj;
|
|
286
|
+
}, "toFlatObject");
|
|
287
|
+
var endsWith = /* @__PURE__ */ __name((str, searchString, position) => {
|
|
288
|
+
str = String(str);
|
|
289
|
+
if (position === void 0 || position > str.length) {
|
|
290
|
+
position = str.length;
|
|
291
|
+
}
|
|
292
|
+
position -= searchString.length;
|
|
293
|
+
const lastIndex = str.indexOf(searchString, position);
|
|
294
|
+
return lastIndex !== -1 && lastIndex === position;
|
|
295
|
+
}, "endsWith");
|
|
296
|
+
var toArray = /* @__PURE__ */ __name((thing) => {
|
|
297
|
+
if (!thing) return null;
|
|
298
|
+
if (isArray(thing)) return thing;
|
|
299
|
+
let i = thing.length;
|
|
300
|
+
if (!isNumber(i)) return null;
|
|
301
|
+
const arr = new Array(i);
|
|
302
|
+
while (i-- > 0) {
|
|
303
|
+
arr[i] = thing[i];
|
|
304
|
+
}
|
|
305
|
+
return arr;
|
|
306
|
+
}, "toArray");
|
|
307
|
+
var isTypedArray = /* @__PURE__ */ ((TypedArray) => {
|
|
308
|
+
return (thing) => {
|
|
309
|
+
return TypedArray && thing instanceof TypedArray;
|
|
310
|
+
};
|
|
311
|
+
})(typeof Uint8Array !== "undefined" && getPrototypeOf(Uint8Array));
|
|
312
|
+
var forEachEntry = /* @__PURE__ */ __name((obj, fn) => {
|
|
313
|
+
const generator = obj && obj[iterator];
|
|
314
|
+
const _iterator = generator.call(obj);
|
|
315
|
+
let result;
|
|
316
|
+
while ((result = _iterator.next()) && !result.done) {
|
|
317
|
+
const pair = result.value;
|
|
318
|
+
fn.call(obj, pair[0], pair[1]);
|
|
319
|
+
}
|
|
320
|
+
}, "forEachEntry");
|
|
321
|
+
var matchAll = /* @__PURE__ */ __name((regExp, str) => {
|
|
322
|
+
let matches;
|
|
323
|
+
const arr = [];
|
|
324
|
+
while ((matches = regExp.exec(str)) !== null) {
|
|
325
|
+
arr.push(matches);
|
|
326
|
+
}
|
|
327
|
+
return arr;
|
|
328
|
+
}, "matchAll");
|
|
329
|
+
var isHTMLForm = kindOfTest("HTMLFormElement");
|
|
330
|
+
var toCamelCase = /* @__PURE__ */ __name((str) => {
|
|
331
|
+
return str.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g, /* @__PURE__ */ __name(function replacer(m, p1, p2) {
|
|
332
|
+
return p1.toUpperCase() + p2;
|
|
333
|
+
}, "replacer"));
|
|
334
|
+
}, "toCamelCase");
|
|
335
|
+
var hasOwnProperty = (({ hasOwnProperty: hasOwnProperty2 }) => (obj, prop) => hasOwnProperty2.call(obj, prop))(Object.prototype);
|
|
336
|
+
var isRegExp = kindOfTest("RegExp");
|
|
337
|
+
var reduceDescriptors = /* @__PURE__ */ __name((obj, reducer) => {
|
|
338
|
+
const descriptors = Object.getOwnPropertyDescriptors(obj);
|
|
339
|
+
const reducedDescriptors = {};
|
|
340
|
+
forEach(descriptors, (descriptor, name) => {
|
|
341
|
+
let ret;
|
|
342
|
+
if ((ret = reducer(descriptor, name, obj)) !== false) {
|
|
343
|
+
reducedDescriptors[name] = ret || descriptor;
|
|
344
|
+
}
|
|
345
|
+
});
|
|
346
|
+
Object.defineProperties(obj, reducedDescriptors);
|
|
347
|
+
}, "reduceDescriptors");
|
|
348
|
+
var freezeMethods = /* @__PURE__ */ __name((obj) => {
|
|
349
|
+
reduceDescriptors(obj, (descriptor, name) => {
|
|
350
|
+
if (isFunction$1(obj) && ["arguments", "caller", "callee"].indexOf(name) !== -1) {
|
|
351
|
+
return false;
|
|
352
|
+
}
|
|
353
|
+
const value = obj[name];
|
|
354
|
+
if (!isFunction$1(value)) return;
|
|
355
|
+
descriptor.enumerable = false;
|
|
356
|
+
if ("writable" in descriptor) {
|
|
357
|
+
descriptor.writable = false;
|
|
358
|
+
return;
|
|
359
|
+
}
|
|
360
|
+
if (!descriptor.set) {
|
|
361
|
+
descriptor.set = () => {
|
|
362
|
+
throw Error("Can not rewrite read-only method '" + name + "'");
|
|
363
|
+
};
|
|
364
|
+
}
|
|
365
|
+
});
|
|
366
|
+
}, "freezeMethods");
|
|
367
|
+
var toObjectSet = /* @__PURE__ */ __name((arrayOrString, delimiter) => {
|
|
368
|
+
const obj = {};
|
|
369
|
+
const define = /* @__PURE__ */ __name((arr) => {
|
|
370
|
+
arr.forEach((value) => {
|
|
371
|
+
obj[value] = true;
|
|
372
|
+
});
|
|
373
|
+
}, "define");
|
|
374
|
+
isArray(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter));
|
|
375
|
+
return obj;
|
|
376
|
+
}, "toObjectSet");
|
|
377
|
+
var noop = /* @__PURE__ */ __name(() => {
|
|
378
|
+
}, "noop");
|
|
379
|
+
var toFiniteNumber = /* @__PURE__ */ __name((value, defaultValue) => {
|
|
380
|
+
return value != null && Number.isFinite(value = +value) ? value : defaultValue;
|
|
381
|
+
}, "toFiniteNumber");
|
|
382
|
+
function isSpecCompliantForm(thing) {
|
|
383
|
+
return !!(thing && isFunction$1(thing.append) && thing[toStringTag] === "FormData" && thing[iterator]);
|
|
384
|
+
}
|
|
385
|
+
__name(isSpecCompliantForm, "isSpecCompliantForm");
|
|
386
|
+
var toJSONObject = /* @__PURE__ */ __name((obj) => {
|
|
387
|
+
const stack = new Array(10);
|
|
388
|
+
const visit = /* @__PURE__ */ __name((source, i) => {
|
|
389
|
+
if (isObject(source)) {
|
|
390
|
+
if (stack.indexOf(source) >= 0) {
|
|
391
|
+
return;
|
|
392
|
+
}
|
|
393
|
+
if (isBuffer(source)) {
|
|
394
|
+
return source;
|
|
395
|
+
}
|
|
396
|
+
if (!("toJSON" in source)) {
|
|
397
|
+
stack[i] = source;
|
|
398
|
+
const target = isArray(source) ? [] : {};
|
|
399
|
+
forEach(source, (value, key) => {
|
|
400
|
+
const reducedValue = visit(value, i + 1);
|
|
401
|
+
!isUndefined(reducedValue) && (target[key] = reducedValue);
|
|
402
|
+
});
|
|
403
|
+
stack[i] = void 0;
|
|
404
|
+
return target;
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
return source;
|
|
408
|
+
}, "visit");
|
|
409
|
+
return visit(obj, 0);
|
|
410
|
+
}, "toJSONObject");
|
|
411
|
+
var isAsyncFn = kindOfTest("AsyncFunction");
|
|
412
|
+
var isThenable = /* @__PURE__ */ __name((thing) => thing && (isObject(thing) || isFunction$1(thing)) && isFunction$1(thing.then) && isFunction$1(thing.catch), "isThenable");
|
|
413
|
+
var _setImmediate = ((setImmediateSupported, postMessageSupported) => {
|
|
414
|
+
if (setImmediateSupported) {
|
|
415
|
+
return setImmediate;
|
|
416
|
+
}
|
|
417
|
+
return postMessageSupported ? ((token, callbacks) => {
|
|
418
|
+
_global.addEventListener(
|
|
419
|
+
"message",
|
|
420
|
+
({ source, data }) => {
|
|
421
|
+
if (source === _global && data === token) {
|
|
422
|
+
callbacks.length && callbacks.shift()();
|
|
423
|
+
}
|
|
424
|
+
},
|
|
425
|
+
false
|
|
426
|
+
);
|
|
427
|
+
return (cb) => {
|
|
428
|
+
callbacks.push(cb);
|
|
429
|
+
_global.postMessage(token, "*");
|
|
430
|
+
};
|
|
431
|
+
})(`axios@${Math.random()}`, []) : (cb) => setTimeout(cb);
|
|
432
|
+
})(typeof setImmediate === "function", isFunction$1(_global.postMessage));
|
|
433
|
+
var asap = typeof queueMicrotask !== "undefined" ? queueMicrotask.bind(_global) : typeof process !== "undefined" && process.nextTick || _setImmediate;
|
|
434
|
+
var isIterable = /* @__PURE__ */ __name((thing) => thing != null && isFunction$1(thing[iterator]), "isIterable");
|
|
435
|
+
var utils$1 = {
|
|
436
|
+
isArray,
|
|
437
|
+
isArrayBuffer,
|
|
438
|
+
isBuffer,
|
|
439
|
+
isFormData,
|
|
440
|
+
isArrayBufferView,
|
|
441
|
+
isString,
|
|
442
|
+
isNumber,
|
|
443
|
+
isBoolean,
|
|
444
|
+
isObject,
|
|
445
|
+
isPlainObject,
|
|
446
|
+
isEmptyObject,
|
|
447
|
+
isReadableStream,
|
|
448
|
+
isRequest,
|
|
449
|
+
isResponse,
|
|
450
|
+
isHeaders,
|
|
451
|
+
isUndefined,
|
|
452
|
+
isDate,
|
|
453
|
+
isFile,
|
|
454
|
+
isReactNativeBlob,
|
|
455
|
+
isReactNative,
|
|
456
|
+
isBlob,
|
|
457
|
+
isRegExp,
|
|
458
|
+
isFunction: isFunction$1,
|
|
459
|
+
isStream,
|
|
460
|
+
isURLSearchParams,
|
|
461
|
+
isTypedArray,
|
|
462
|
+
isFileList,
|
|
463
|
+
forEach,
|
|
464
|
+
merge,
|
|
465
|
+
extend,
|
|
466
|
+
trim,
|
|
467
|
+
stripBOM,
|
|
468
|
+
inherits,
|
|
469
|
+
toFlatObject,
|
|
470
|
+
kindOf,
|
|
471
|
+
kindOfTest,
|
|
472
|
+
endsWith,
|
|
473
|
+
toArray,
|
|
474
|
+
forEachEntry,
|
|
475
|
+
matchAll,
|
|
476
|
+
isHTMLForm,
|
|
477
|
+
hasOwnProperty,
|
|
478
|
+
hasOwnProp: hasOwnProperty,
|
|
479
|
+
// an alias to avoid ESLint no-prototype-builtins detection
|
|
480
|
+
reduceDescriptors,
|
|
481
|
+
freezeMethods,
|
|
482
|
+
toObjectSet,
|
|
483
|
+
toCamelCase,
|
|
484
|
+
noop,
|
|
485
|
+
toFiniteNumber,
|
|
486
|
+
findKey,
|
|
487
|
+
global: _global,
|
|
488
|
+
isContextDefined,
|
|
489
|
+
isSpecCompliantForm,
|
|
490
|
+
toJSONObject,
|
|
491
|
+
isAsyncFn,
|
|
492
|
+
isThenable,
|
|
493
|
+
setImmediate: _setImmediate,
|
|
494
|
+
asap,
|
|
495
|
+
isIterable
|
|
496
|
+
};
|
|
497
|
+
var AxiosError = class _AxiosError extends Error {
|
|
498
|
+
static {
|
|
499
|
+
__name(this, "AxiosError");
|
|
500
|
+
}
|
|
501
|
+
static from(error, code, config, request, response, customProps) {
|
|
502
|
+
const axiosError = new _AxiosError(error.message, code || error.code, config, request, response);
|
|
503
|
+
axiosError.cause = error;
|
|
504
|
+
axiosError.name = error.name;
|
|
505
|
+
if (error.status != null && axiosError.status == null) {
|
|
506
|
+
axiosError.status = error.status;
|
|
507
|
+
}
|
|
508
|
+
customProps && Object.assign(axiosError, customProps);
|
|
509
|
+
return axiosError;
|
|
510
|
+
}
|
|
511
|
+
/**
|
|
512
|
+
* Create an Error with the specified message, config, error code, request and response.
|
|
513
|
+
*
|
|
514
|
+
* @param {string} message The error message.
|
|
515
|
+
* @param {string} [code] The error code (for example, 'ECONNABORTED').
|
|
516
|
+
* @param {Object} [config] The config.
|
|
517
|
+
* @param {Object} [request] The request.
|
|
518
|
+
* @param {Object} [response] The response.
|
|
519
|
+
*
|
|
520
|
+
* @returns {Error} The created error.
|
|
521
|
+
*/
|
|
522
|
+
constructor(message, code, config, request, response) {
|
|
523
|
+
super(message);
|
|
524
|
+
Object.defineProperty(this, "message", {
|
|
525
|
+
value: message,
|
|
526
|
+
enumerable: true,
|
|
527
|
+
writable: true,
|
|
528
|
+
configurable: true
|
|
529
|
+
});
|
|
530
|
+
this.name = "AxiosError";
|
|
531
|
+
this.isAxiosError = true;
|
|
532
|
+
code && (this.code = code);
|
|
533
|
+
config && (this.config = config);
|
|
534
|
+
request && (this.request = request);
|
|
535
|
+
if (response) {
|
|
536
|
+
this.response = response;
|
|
537
|
+
this.status = response.status;
|
|
538
|
+
}
|
|
539
|
+
}
|
|
540
|
+
toJSON() {
|
|
541
|
+
return {
|
|
542
|
+
// Standard
|
|
543
|
+
message: this.message,
|
|
544
|
+
name: this.name,
|
|
545
|
+
// Microsoft
|
|
546
|
+
description: this.description,
|
|
547
|
+
number: this.number,
|
|
548
|
+
// Mozilla
|
|
549
|
+
fileName: this.fileName,
|
|
550
|
+
lineNumber: this.lineNumber,
|
|
551
|
+
columnNumber: this.columnNumber,
|
|
552
|
+
stack: this.stack,
|
|
553
|
+
// Axios
|
|
554
|
+
config: utils$1.toJSONObject(this.config),
|
|
555
|
+
code: this.code,
|
|
556
|
+
status: this.status
|
|
557
|
+
};
|
|
558
|
+
}
|
|
559
|
+
};
|
|
560
|
+
AxiosError.ERR_BAD_OPTION_VALUE = "ERR_BAD_OPTION_VALUE";
|
|
561
|
+
AxiosError.ERR_BAD_OPTION = "ERR_BAD_OPTION";
|
|
562
|
+
AxiosError.ECONNABORTED = "ECONNABORTED";
|
|
563
|
+
AxiosError.ETIMEDOUT = "ETIMEDOUT";
|
|
564
|
+
AxiosError.ERR_NETWORK = "ERR_NETWORK";
|
|
565
|
+
AxiosError.ERR_FR_TOO_MANY_REDIRECTS = "ERR_FR_TOO_MANY_REDIRECTS";
|
|
566
|
+
AxiosError.ERR_DEPRECATED = "ERR_DEPRECATED";
|
|
567
|
+
AxiosError.ERR_BAD_RESPONSE = "ERR_BAD_RESPONSE";
|
|
568
|
+
AxiosError.ERR_BAD_REQUEST = "ERR_BAD_REQUEST";
|
|
569
|
+
AxiosError.ERR_CANCELED = "ERR_CANCELED";
|
|
570
|
+
AxiosError.ERR_NOT_SUPPORT = "ERR_NOT_SUPPORT";
|
|
571
|
+
AxiosError.ERR_INVALID_URL = "ERR_INVALID_URL";
|
|
572
|
+
var AxiosError$1 = AxiosError;
|
|
573
|
+
function isVisitable(thing) {
|
|
574
|
+
return utils$1.isPlainObject(thing) || utils$1.isArray(thing);
|
|
575
|
+
}
|
|
576
|
+
__name(isVisitable, "isVisitable");
|
|
577
|
+
function removeBrackets(key) {
|
|
578
|
+
return utils$1.endsWith(key, "[]") ? key.slice(0, -2) : key;
|
|
579
|
+
}
|
|
580
|
+
__name(removeBrackets, "removeBrackets");
|
|
581
|
+
function renderKey(path, key, dots) {
|
|
582
|
+
if (!path) return key;
|
|
583
|
+
return path.concat(key).map(/* @__PURE__ */ __name(function each(token, i) {
|
|
584
|
+
token = removeBrackets(token);
|
|
585
|
+
return !dots && i ? "[" + token + "]" : token;
|
|
586
|
+
}, "each")).join(dots ? "." : "");
|
|
587
|
+
}
|
|
588
|
+
__name(renderKey, "renderKey");
|
|
589
|
+
function isFlatArray(arr) {
|
|
590
|
+
return utils$1.isArray(arr) && !arr.some(isVisitable);
|
|
591
|
+
}
|
|
592
|
+
__name(isFlatArray, "isFlatArray");
|
|
593
|
+
var predicates = utils$1.toFlatObject(utils$1, {}, null, /* @__PURE__ */ __name(function filter(prop) {
|
|
594
|
+
return /^is[A-Z]/.test(prop);
|
|
595
|
+
}, "filter"));
|
|
596
|
+
function toFormData(obj, formData, options) {
|
|
597
|
+
if (!utils$1.isObject(obj)) {
|
|
598
|
+
throw new TypeError("target must be an object");
|
|
599
|
+
}
|
|
600
|
+
formData = formData || new (FormData__default["default"] || FormData)();
|
|
601
|
+
options = utils$1.toFlatObject(
|
|
602
|
+
options,
|
|
603
|
+
{
|
|
604
|
+
metaTokens: true,
|
|
605
|
+
dots: false,
|
|
606
|
+
indexes: false
|
|
607
|
+
},
|
|
608
|
+
false,
|
|
609
|
+
/* @__PURE__ */ __name(function defined(option, source) {
|
|
610
|
+
return !utils$1.isUndefined(source[option]);
|
|
611
|
+
}, "defined")
|
|
612
|
+
);
|
|
613
|
+
const metaTokens = options.metaTokens;
|
|
614
|
+
const visitor = options.visitor || defaultVisitor;
|
|
615
|
+
const dots = options.dots;
|
|
616
|
+
const indexes = options.indexes;
|
|
617
|
+
const _Blob = options.Blob || typeof Blob !== "undefined" && Blob;
|
|
618
|
+
const useBlob = _Blob && utils$1.isSpecCompliantForm(formData);
|
|
619
|
+
if (!utils$1.isFunction(visitor)) {
|
|
620
|
+
throw new TypeError("visitor must be a function");
|
|
621
|
+
}
|
|
622
|
+
function convertValue(value) {
|
|
623
|
+
if (value === null) return "";
|
|
624
|
+
if (utils$1.isDate(value)) {
|
|
625
|
+
return value.toISOString();
|
|
626
|
+
}
|
|
627
|
+
if (utils$1.isBoolean(value)) {
|
|
628
|
+
return value.toString();
|
|
629
|
+
}
|
|
630
|
+
if (!useBlob && utils$1.isBlob(value)) {
|
|
631
|
+
throw new AxiosError$1("Blob is not supported. Use a Buffer instead.");
|
|
632
|
+
}
|
|
633
|
+
if (utils$1.isArrayBuffer(value) || utils$1.isTypedArray(value)) {
|
|
634
|
+
return useBlob && typeof Blob === "function" ? new Blob([value]) : Buffer.from(value);
|
|
635
|
+
}
|
|
636
|
+
return value;
|
|
637
|
+
}
|
|
638
|
+
__name(convertValue, "convertValue");
|
|
639
|
+
function defaultVisitor(value, key, path) {
|
|
640
|
+
let arr = value;
|
|
641
|
+
if (utils$1.isReactNative(formData) && utils$1.isReactNativeBlob(value)) {
|
|
642
|
+
formData.append(renderKey(path, key, dots), convertValue(value));
|
|
643
|
+
return false;
|
|
644
|
+
}
|
|
645
|
+
if (value && !path && typeof value === "object") {
|
|
646
|
+
if (utils$1.endsWith(key, "{}")) {
|
|
647
|
+
key = metaTokens ? key : key.slice(0, -2);
|
|
648
|
+
value = JSON.stringify(value);
|
|
649
|
+
} else if (utils$1.isArray(value) && isFlatArray(value) || (utils$1.isFileList(value) || utils$1.endsWith(key, "[]")) && (arr = utils$1.toArray(value))) {
|
|
650
|
+
key = removeBrackets(key);
|
|
651
|
+
arr.forEach(/* @__PURE__ */ __name(function each(el, index) {
|
|
652
|
+
!(utils$1.isUndefined(el) || el === null) && formData.append(
|
|
653
|
+
// eslint-disable-next-line no-nested-ternary
|
|
654
|
+
indexes === true ? renderKey([key], index, dots) : indexes === null ? key : key + "[]",
|
|
655
|
+
convertValue(el)
|
|
656
|
+
);
|
|
657
|
+
}, "each"));
|
|
658
|
+
return false;
|
|
659
|
+
}
|
|
660
|
+
}
|
|
661
|
+
if (isVisitable(value)) {
|
|
662
|
+
return true;
|
|
663
|
+
}
|
|
664
|
+
formData.append(renderKey(path, key, dots), convertValue(value));
|
|
665
|
+
return false;
|
|
666
|
+
}
|
|
667
|
+
__name(defaultVisitor, "defaultVisitor");
|
|
668
|
+
const stack = [];
|
|
669
|
+
const exposedHelpers = Object.assign(predicates, {
|
|
670
|
+
defaultVisitor,
|
|
671
|
+
convertValue,
|
|
672
|
+
isVisitable
|
|
673
|
+
});
|
|
674
|
+
function build(value, path) {
|
|
675
|
+
if (utils$1.isUndefined(value)) return;
|
|
676
|
+
if (stack.indexOf(value) !== -1) {
|
|
677
|
+
throw Error("Circular reference detected in " + path.join("."));
|
|
678
|
+
}
|
|
679
|
+
stack.push(value);
|
|
680
|
+
utils$1.forEach(value, /* @__PURE__ */ __name(function each(el, key) {
|
|
681
|
+
const result = !(utils$1.isUndefined(el) || el === null) && visitor.call(formData, el, utils$1.isString(key) ? key.trim() : key, path, exposedHelpers);
|
|
682
|
+
if (result === true) {
|
|
683
|
+
build(el, path ? path.concat(key) : [key]);
|
|
684
|
+
}
|
|
685
|
+
}, "each"));
|
|
686
|
+
stack.pop();
|
|
687
|
+
}
|
|
688
|
+
__name(build, "build");
|
|
689
|
+
if (!utils$1.isObject(obj)) {
|
|
690
|
+
throw new TypeError("data must be an object");
|
|
691
|
+
}
|
|
692
|
+
build(obj);
|
|
693
|
+
return formData;
|
|
694
|
+
}
|
|
695
|
+
__name(toFormData, "toFormData");
|
|
696
|
+
function encode$1(str) {
|
|
697
|
+
const charMap = {
|
|
698
|
+
"!": "%21",
|
|
699
|
+
"'": "%27",
|
|
700
|
+
"(": "%28",
|
|
701
|
+
")": "%29",
|
|
702
|
+
"~": "%7E",
|
|
703
|
+
"%20": "+",
|
|
704
|
+
"%00": "\0"
|
|
705
|
+
};
|
|
706
|
+
return encodeURIComponent(str).replace(/[!'()~]|%20|%00/g, /* @__PURE__ */ __name(function replacer(match) {
|
|
707
|
+
return charMap[match];
|
|
708
|
+
}, "replacer"));
|
|
709
|
+
}
|
|
710
|
+
__name(encode$1, "encode$1");
|
|
711
|
+
function AxiosURLSearchParams(params, options) {
|
|
712
|
+
this._pairs = [];
|
|
713
|
+
params && toFormData(params, this, options);
|
|
714
|
+
}
|
|
715
|
+
__name(AxiosURLSearchParams, "AxiosURLSearchParams");
|
|
716
|
+
var prototype = AxiosURLSearchParams.prototype;
|
|
717
|
+
prototype.append = /* @__PURE__ */ __name(function append(name, value) {
|
|
718
|
+
this._pairs.push([name, value]);
|
|
719
|
+
}, "append");
|
|
720
|
+
prototype.toString = /* @__PURE__ */ __name(function toString2(encoder) {
|
|
721
|
+
const _encode = encoder ? function(value) {
|
|
722
|
+
return encoder.call(this, value, encode$1);
|
|
723
|
+
} : encode$1;
|
|
724
|
+
return this._pairs.map(/* @__PURE__ */ __name(function each(pair) {
|
|
725
|
+
return _encode(pair[0]) + "=" + _encode(pair[1]);
|
|
726
|
+
}, "each"), "").join("&");
|
|
727
|
+
}, "toString");
|
|
728
|
+
function encode(val) {
|
|
729
|
+
return encodeURIComponent(val).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+");
|
|
730
|
+
}
|
|
731
|
+
__name(encode, "encode");
|
|
732
|
+
function buildURL(url2, params, options) {
|
|
733
|
+
if (!params) {
|
|
734
|
+
return url2;
|
|
735
|
+
}
|
|
736
|
+
const _encode = options && options.encode || encode;
|
|
737
|
+
const _options = utils$1.isFunction(options) ? {
|
|
738
|
+
serialize: options
|
|
739
|
+
} : options;
|
|
740
|
+
const serializeFn = _options && _options.serialize;
|
|
741
|
+
let serializedParams;
|
|
742
|
+
if (serializeFn) {
|
|
743
|
+
serializedParams = serializeFn(params, _options);
|
|
744
|
+
} else {
|
|
745
|
+
serializedParams = utils$1.isURLSearchParams(params) ? params.toString() : new AxiosURLSearchParams(params, _options).toString(_encode);
|
|
746
|
+
}
|
|
747
|
+
if (serializedParams) {
|
|
748
|
+
const hashmarkIndex = url2.indexOf("#");
|
|
749
|
+
if (hashmarkIndex !== -1) {
|
|
750
|
+
url2 = url2.slice(0, hashmarkIndex);
|
|
751
|
+
}
|
|
752
|
+
url2 += (url2.indexOf("?") === -1 ? "?" : "&") + serializedParams;
|
|
753
|
+
}
|
|
754
|
+
return url2;
|
|
755
|
+
}
|
|
756
|
+
__name(buildURL, "buildURL");
|
|
757
|
+
var InterceptorManager = class {
|
|
758
|
+
static {
|
|
759
|
+
__name(this, "InterceptorManager");
|
|
760
|
+
}
|
|
761
|
+
constructor() {
|
|
762
|
+
this.handlers = [];
|
|
763
|
+
}
|
|
764
|
+
/**
|
|
765
|
+
* Add a new interceptor to the stack
|
|
766
|
+
*
|
|
767
|
+
* @param {Function} fulfilled The function to handle `then` for a `Promise`
|
|
768
|
+
* @param {Function} rejected The function to handle `reject` for a `Promise`
|
|
769
|
+
* @param {Object} options The options for the interceptor, synchronous and runWhen
|
|
770
|
+
*
|
|
771
|
+
* @return {Number} An ID used to remove interceptor later
|
|
772
|
+
*/
|
|
773
|
+
use(fulfilled, rejected, options) {
|
|
774
|
+
this.handlers.push({
|
|
775
|
+
fulfilled,
|
|
776
|
+
rejected,
|
|
777
|
+
synchronous: options ? options.synchronous : false,
|
|
778
|
+
runWhen: options ? options.runWhen : null
|
|
779
|
+
});
|
|
780
|
+
return this.handlers.length - 1;
|
|
781
|
+
}
|
|
782
|
+
/**
|
|
783
|
+
* Remove an interceptor from the stack
|
|
784
|
+
*
|
|
785
|
+
* @param {Number} id The ID that was returned by `use`
|
|
786
|
+
*
|
|
787
|
+
* @returns {void}
|
|
788
|
+
*/
|
|
789
|
+
eject(id) {
|
|
790
|
+
if (this.handlers[id]) {
|
|
791
|
+
this.handlers[id] = null;
|
|
792
|
+
}
|
|
793
|
+
}
|
|
794
|
+
/**
|
|
795
|
+
* Clear all interceptors from the stack
|
|
796
|
+
*
|
|
797
|
+
* @returns {void}
|
|
798
|
+
*/
|
|
799
|
+
clear() {
|
|
800
|
+
if (this.handlers) {
|
|
801
|
+
this.handlers = [];
|
|
802
|
+
}
|
|
803
|
+
}
|
|
804
|
+
/**
|
|
805
|
+
* Iterate over all the registered interceptors
|
|
806
|
+
*
|
|
807
|
+
* This method is particularly useful for skipping over any
|
|
808
|
+
* interceptors that may have become `null` calling `eject`.
|
|
809
|
+
*
|
|
810
|
+
* @param {Function} fn The function to call for each interceptor
|
|
811
|
+
*
|
|
812
|
+
* @returns {void}
|
|
813
|
+
*/
|
|
814
|
+
forEach(fn) {
|
|
815
|
+
utils$1.forEach(this.handlers, /* @__PURE__ */ __name(function forEachHandler(h) {
|
|
816
|
+
if (h !== null) {
|
|
817
|
+
fn(h);
|
|
818
|
+
}
|
|
819
|
+
}, "forEachHandler"));
|
|
820
|
+
}
|
|
821
|
+
};
|
|
822
|
+
var InterceptorManager$1 = InterceptorManager;
|
|
823
|
+
var transitionalDefaults = {
|
|
824
|
+
silentJSONParsing: true,
|
|
825
|
+
forcedJSONParsing: true,
|
|
826
|
+
clarifyTimeoutError: false,
|
|
827
|
+
legacyInterceptorReqResOrdering: true
|
|
828
|
+
};
|
|
829
|
+
var URLSearchParams = url__default["default"].URLSearchParams;
|
|
830
|
+
var ALPHA = "abcdefghijklmnopqrstuvwxyz";
|
|
831
|
+
var DIGIT = "0123456789";
|
|
832
|
+
var ALPHABET = {
|
|
833
|
+
DIGIT,
|
|
834
|
+
ALPHA,
|
|
835
|
+
ALPHA_DIGIT: ALPHA + ALPHA.toUpperCase() + DIGIT
|
|
836
|
+
};
|
|
837
|
+
var generateString = /* @__PURE__ */ __name((size = 16, alphabet = ALPHABET.ALPHA_DIGIT) => {
|
|
838
|
+
let str = "";
|
|
839
|
+
const { length } = alphabet;
|
|
840
|
+
const randomValues = new Uint32Array(size);
|
|
841
|
+
crypto__default["default"].randomFillSync(randomValues);
|
|
842
|
+
for (let i = 0; i < size; i++) {
|
|
843
|
+
str += alphabet[randomValues[i] % length];
|
|
844
|
+
}
|
|
845
|
+
return str;
|
|
846
|
+
}, "generateString");
|
|
847
|
+
var platform$1 = {
|
|
848
|
+
isNode: true,
|
|
849
|
+
classes: {
|
|
850
|
+
URLSearchParams,
|
|
851
|
+
FormData: FormData__default["default"],
|
|
852
|
+
Blob: typeof Blob !== "undefined" && Blob || null
|
|
853
|
+
},
|
|
854
|
+
ALPHABET,
|
|
855
|
+
generateString,
|
|
856
|
+
protocols: ["http", "https", "file", "data"]
|
|
857
|
+
};
|
|
858
|
+
var hasBrowserEnv = typeof window !== "undefined" && typeof document !== "undefined";
|
|
859
|
+
var _navigator = typeof navigator === "object" && navigator || void 0;
|
|
860
|
+
var hasStandardBrowserEnv = hasBrowserEnv && (!_navigator || ["ReactNative", "NativeScript", "NS"].indexOf(_navigator.product) < 0);
|
|
861
|
+
var hasStandardBrowserWebWorkerEnv = (() => {
|
|
862
|
+
return typeof WorkerGlobalScope !== "undefined" && // eslint-disable-next-line no-undef
|
|
863
|
+
self instanceof WorkerGlobalScope && typeof self.importScripts === "function";
|
|
864
|
+
})();
|
|
865
|
+
var origin = hasBrowserEnv && window.location.href || "http://localhost";
|
|
866
|
+
var utils = /* @__PURE__ */ Object.freeze({
|
|
867
|
+
__proto__: null,
|
|
868
|
+
hasBrowserEnv,
|
|
869
|
+
hasStandardBrowserWebWorkerEnv,
|
|
870
|
+
hasStandardBrowserEnv,
|
|
871
|
+
navigator: _navigator,
|
|
872
|
+
origin
|
|
873
|
+
});
|
|
874
|
+
var platform = {
|
|
875
|
+
...utils,
|
|
876
|
+
...platform$1
|
|
877
|
+
};
|
|
878
|
+
function toURLEncodedForm(data, options) {
|
|
879
|
+
return toFormData(data, new platform.classes.URLSearchParams(), {
|
|
880
|
+
visitor: /* @__PURE__ */ __name(function(value, key, path, helpers) {
|
|
881
|
+
if (platform.isNode && utils$1.isBuffer(value)) {
|
|
882
|
+
this.append(key, value.toString("base64"));
|
|
883
|
+
return false;
|
|
884
|
+
}
|
|
885
|
+
return helpers.defaultVisitor.apply(this, arguments);
|
|
886
|
+
}, "visitor"),
|
|
887
|
+
...options
|
|
888
|
+
});
|
|
889
|
+
}
|
|
890
|
+
__name(toURLEncodedForm, "toURLEncodedForm");
|
|
891
|
+
function parsePropPath(name) {
|
|
892
|
+
return utils$1.matchAll(/\w+|\[(\w*)]/g, name).map((match) => {
|
|
893
|
+
return match[0] === "[]" ? "" : match[1] || match[0];
|
|
894
|
+
});
|
|
895
|
+
}
|
|
896
|
+
__name(parsePropPath, "parsePropPath");
|
|
897
|
+
function arrayToObject(arr) {
|
|
898
|
+
const obj = {};
|
|
899
|
+
const keys = Object.keys(arr);
|
|
900
|
+
let i;
|
|
901
|
+
const len = keys.length;
|
|
902
|
+
let key;
|
|
903
|
+
for (i = 0; i < len; i++) {
|
|
904
|
+
key = keys[i];
|
|
905
|
+
obj[key] = arr[key];
|
|
906
|
+
}
|
|
907
|
+
return obj;
|
|
908
|
+
}
|
|
909
|
+
__name(arrayToObject, "arrayToObject");
|
|
910
|
+
function formDataToJSON(formData) {
|
|
911
|
+
function buildPath(path, value, target, index) {
|
|
912
|
+
let name = path[index++];
|
|
913
|
+
if (name === "__proto__") return true;
|
|
914
|
+
const isNumericKey = Number.isFinite(+name);
|
|
915
|
+
const isLast = index >= path.length;
|
|
916
|
+
name = !name && utils$1.isArray(target) ? target.length : name;
|
|
917
|
+
if (isLast) {
|
|
918
|
+
if (utils$1.hasOwnProp(target, name)) {
|
|
919
|
+
target[name] = [target[name], value];
|
|
920
|
+
} else {
|
|
921
|
+
target[name] = value;
|
|
922
|
+
}
|
|
923
|
+
return !isNumericKey;
|
|
924
|
+
}
|
|
925
|
+
if (!target[name] || !utils$1.isObject(target[name])) {
|
|
926
|
+
target[name] = [];
|
|
927
|
+
}
|
|
928
|
+
const result = buildPath(path, value, target[name], index);
|
|
929
|
+
if (result && utils$1.isArray(target[name])) {
|
|
930
|
+
target[name] = arrayToObject(target[name]);
|
|
931
|
+
}
|
|
932
|
+
return !isNumericKey;
|
|
933
|
+
}
|
|
934
|
+
__name(buildPath, "buildPath");
|
|
935
|
+
if (utils$1.isFormData(formData) && utils$1.isFunction(formData.entries)) {
|
|
936
|
+
const obj = {};
|
|
937
|
+
utils$1.forEachEntry(formData, (name, value) => {
|
|
938
|
+
buildPath(parsePropPath(name), value, obj, 0);
|
|
939
|
+
});
|
|
940
|
+
return obj;
|
|
941
|
+
}
|
|
942
|
+
return null;
|
|
943
|
+
}
|
|
944
|
+
__name(formDataToJSON, "formDataToJSON");
|
|
945
|
+
function stringifySafely(rawValue, parser, encoder) {
|
|
946
|
+
if (utils$1.isString(rawValue)) {
|
|
947
|
+
try {
|
|
948
|
+
(parser || JSON.parse)(rawValue);
|
|
949
|
+
return utils$1.trim(rawValue);
|
|
950
|
+
} catch (e) {
|
|
951
|
+
if (e.name !== "SyntaxError") {
|
|
952
|
+
throw e;
|
|
953
|
+
}
|
|
954
|
+
}
|
|
955
|
+
}
|
|
956
|
+
return (encoder || JSON.stringify)(rawValue);
|
|
957
|
+
}
|
|
958
|
+
__name(stringifySafely, "stringifySafely");
|
|
959
|
+
var defaults = {
|
|
960
|
+
transitional: transitionalDefaults,
|
|
961
|
+
adapter: ["xhr", "http", "fetch"],
|
|
962
|
+
transformRequest: [
|
|
963
|
+
/* @__PURE__ */ __name(function transformRequest(data, headers) {
|
|
964
|
+
const contentType = headers.getContentType() || "";
|
|
965
|
+
const hasJSONContentType = contentType.indexOf("application/json") > -1;
|
|
966
|
+
const isObjectPayload = utils$1.isObject(data);
|
|
967
|
+
if (isObjectPayload && utils$1.isHTMLForm(data)) {
|
|
968
|
+
data = new FormData(data);
|
|
969
|
+
}
|
|
970
|
+
const isFormData2 = utils$1.isFormData(data);
|
|
971
|
+
if (isFormData2) {
|
|
972
|
+
return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data;
|
|
973
|
+
}
|
|
974
|
+
if (utils$1.isArrayBuffer(data) || utils$1.isBuffer(data) || utils$1.isStream(data) || utils$1.isFile(data) || utils$1.isBlob(data) || utils$1.isReadableStream(data)) {
|
|
975
|
+
return data;
|
|
976
|
+
}
|
|
977
|
+
if (utils$1.isArrayBufferView(data)) {
|
|
978
|
+
return data.buffer;
|
|
979
|
+
}
|
|
980
|
+
if (utils$1.isURLSearchParams(data)) {
|
|
981
|
+
headers.setContentType("application/x-www-form-urlencoded;charset=utf-8", false);
|
|
982
|
+
return data.toString();
|
|
983
|
+
}
|
|
984
|
+
let isFileList2;
|
|
985
|
+
if (isObjectPayload) {
|
|
986
|
+
if (contentType.indexOf("application/x-www-form-urlencoded") > -1) {
|
|
987
|
+
return toURLEncodedForm(data, this.formSerializer).toString();
|
|
988
|
+
}
|
|
989
|
+
if ((isFileList2 = utils$1.isFileList(data)) || contentType.indexOf("multipart/form-data") > -1) {
|
|
990
|
+
const _FormData = this.env && this.env.FormData;
|
|
991
|
+
return toFormData(
|
|
992
|
+
isFileList2 ? { "files[]": data } : data,
|
|
993
|
+
_FormData && new _FormData(),
|
|
994
|
+
this.formSerializer
|
|
995
|
+
);
|
|
996
|
+
}
|
|
997
|
+
}
|
|
998
|
+
if (isObjectPayload || hasJSONContentType) {
|
|
999
|
+
headers.setContentType("application/json", false);
|
|
1000
|
+
return stringifySafely(data);
|
|
1001
|
+
}
|
|
1002
|
+
return data;
|
|
1003
|
+
}, "transformRequest")
|
|
1004
|
+
],
|
|
1005
|
+
transformResponse: [
|
|
1006
|
+
/* @__PURE__ */ __name(function transformResponse(data) {
|
|
1007
|
+
const transitional = this.transitional || defaults.transitional;
|
|
1008
|
+
const forcedJSONParsing = transitional && transitional.forcedJSONParsing;
|
|
1009
|
+
const JSONRequested = this.responseType === "json";
|
|
1010
|
+
if (utils$1.isResponse(data) || utils$1.isReadableStream(data)) {
|
|
1011
|
+
return data;
|
|
1012
|
+
}
|
|
1013
|
+
if (data && utils$1.isString(data) && (forcedJSONParsing && !this.responseType || JSONRequested)) {
|
|
1014
|
+
const silentJSONParsing = transitional && transitional.silentJSONParsing;
|
|
1015
|
+
const strictJSONParsing = !silentJSONParsing && JSONRequested;
|
|
1016
|
+
try {
|
|
1017
|
+
return JSON.parse(data, this.parseReviver);
|
|
1018
|
+
} catch (e) {
|
|
1019
|
+
if (strictJSONParsing) {
|
|
1020
|
+
if (e.name === "SyntaxError") {
|
|
1021
|
+
throw AxiosError$1.from(e, AxiosError$1.ERR_BAD_RESPONSE, this, null, this.response);
|
|
1022
|
+
}
|
|
1023
|
+
throw e;
|
|
1024
|
+
}
|
|
1025
|
+
}
|
|
1026
|
+
}
|
|
1027
|
+
return data;
|
|
1028
|
+
}, "transformResponse")
|
|
1029
|
+
],
|
|
1030
|
+
/**
|
|
1031
|
+
* A timeout in milliseconds to abort a request. If set to 0 (default) a
|
|
1032
|
+
* timeout is not created.
|
|
1033
|
+
*/
|
|
1034
|
+
timeout: 0,
|
|
1035
|
+
xsrfCookieName: "XSRF-TOKEN",
|
|
1036
|
+
xsrfHeaderName: "X-XSRF-TOKEN",
|
|
1037
|
+
maxContentLength: -1,
|
|
1038
|
+
maxBodyLength: -1,
|
|
1039
|
+
env: {
|
|
1040
|
+
FormData: platform.classes.FormData,
|
|
1041
|
+
Blob: platform.classes.Blob
|
|
1042
|
+
},
|
|
1043
|
+
validateStatus: /* @__PURE__ */ __name(function validateStatus(status) {
|
|
1044
|
+
return status >= 200 && status < 300;
|
|
1045
|
+
}, "validateStatus"),
|
|
1046
|
+
headers: {
|
|
1047
|
+
common: {
|
|
1048
|
+
Accept: "application/json, text/plain, */*",
|
|
1049
|
+
"Content-Type": void 0
|
|
1050
|
+
}
|
|
1051
|
+
}
|
|
1052
|
+
};
|
|
1053
|
+
utils$1.forEach(["delete", "get", "head", "post", "put", "patch"], (method) => {
|
|
1054
|
+
defaults.headers[method] = {};
|
|
1055
|
+
});
|
|
1056
|
+
var defaults$1 = defaults;
|
|
1057
|
+
var ignoreDuplicateOf = utils$1.toObjectSet([
|
|
1058
|
+
"age",
|
|
1059
|
+
"authorization",
|
|
1060
|
+
"content-length",
|
|
1061
|
+
"content-type",
|
|
1062
|
+
"etag",
|
|
1063
|
+
"expires",
|
|
1064
|
+
"from",
|
|
1065
|
+
"host",
|
|
1066
|
+
"if-modified-since",
|
|
1067
|
+
"if-unmodified-since",
|
|
1068
|
+
"last-modified",
|
|
1069
|
+
"location",
|
|
1070
|
+
"max-forwards",
|
|
1071
|
+
"proxy-authorization",
|
|
1072
|
+
"referer",
|
|
1073
|
+
"retry-after",
|
|
1074
|
+
"user-agent"
|
|
1075
|
+
]);
|
|
1076
|
+
var parseHeaders = /* @__PURE__ */ __name((rawHeaders) => {
|
|
1077
|
+
const parsed = {};
|
|
1078
|
+
let key;
|
|
1079
|
+
let val;
|
|
1080
|
+
let i;
|
|
1081
|
+
rawHeaders && rawHeaders.split("\n").forEach(/* @__PURE__ */ __name(function parser(line) {
|
|
1082
|
+
i = line.indexOf(":");
|
|
1083
|
+
key = line.substring(0, i).trim().toLowerCase();
|
|
1084
|
+
val = line.substring(i + 1).trim();
|
|
1085
|
+
if (!key || parsed[key] && ignoreDuplicateOf[key]) {
|
|
1086
|
+
return;
|
|
1087
|
+
}
|
|
1088
|
+
if (key === "set-cookie") {
|
|
1089
|
+
if (parsed[key]) {
|
|
1090
|
+
parsed[key].push(val);
|
|
1091
|
+
} else {
|
|
1092
|
+
parsed[key] = [val];
|
|
1093
|
+
}
|
|
1094
|
+
} else {
|
|
1095
|
+
parsed[key] = parsed[key] ? parsed[key] + ", " + val : val;
|
|
1096
|
+
}
|
|
1097
|
+
}, "parser"));
|
|
1098
|
+
return parsed;
|
|
1099
|
+
}, "parseHeaders");
|
|
1100
|
+
var $internals = Symbol("internals");
|
|
1101
|
+
function normalizeHeader(header) {
|
|
1102
|
+
return header && String(header).trim().toLowerCase();
|
|
1103
|
+
}
|
|
1104
|
+
__name(normalizeHeader, "normalizeHeader");
|
|
1105
|
+
function normalizeValue(value) {
|
|
1106
|
+
if (value === false || value == null) {
|
|
1107
|
+
return value;
|
|
1108
|
+
}
|
|
1109
|
+
return utils$1.isArray(value) ? value.map(normalizeValue) : String(value);
|
|
1110
|
+
}
|
|
1111
|
+
__name(normalizeValue, "normalizeValue");
|
|
1112
|
+
function parseTokens(str) {
|
|
1113
|
+
const tokens = /* @__PURE__ */ Object.create(null);
|
|
1114
|
+
const tokensRE = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
|
|
1115
|
+
let match;
|
|
1116
|
+
while (match = tokensRE.exec(str)) {
|
|
1117
|
+
tokens[match[1]] = match[2];
|
|
1118
|
+
}
|
|
1119
|
+
return tokens;
|
|
1120
|
+
}
|
|
1121
|
+
__name(parseTokens, "parseTokens");
|
|
1122
|
+
var isValidHeaderName = /* @__PURE__ */ __name((str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim()), "isValidHeaderName");
|
|
1123
|
+
function matchHeaderValue(context, value, header, filter, isHeaderNameFilter) {
|
|
1124
|
+
if (utils$1.isFunction(filter)) {
|
|
1125
|
+
return filter.call(this, value, header);
|
|
1126
|
+
}
|
|
1127
|
+
if (isHeaderNameFilter) {
|
|
1128
|
+
value = header;
|
|
1129
|
+
}
|
|
1130
|
+
if (!utils$1.isString(value)) return;
|
|
1131
|
+
if (utils$1.isString(filter)) {
|
|
1132
|
+
return value.indexOf(filter) !== -1;
|
|
1133
|
+
}
|
|
1134
|
+
if (utils$1.isRegExp(filter)) {
|
|
1135
|
+
return filter.test(value);
|
|
1136
|
+
}
|
|
1137
|
+
}
|
|
1138
|
+
__name(matchHeaderValue, "matchHeaderValue");
|
|
1139
|
+
function formatHeader(header) {
|
|
1140
|
+
return header.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (w, char, str) => {
|
|
1141
|
+
return char.toUpperCase() + str;
|
|
1142
|
+
});
|
|
1143
|
+
}
|
|
1144
|
+
__name(formatHeader, "formatHeader");
|
|
1145
|
+
function buildAccessors(obj, header) {
|
|
1146
|
+
const accessorName = utils$1.toCamelCase(" " + header);
|
|
1147
|
+
["get", "set", "has"].forEach((methodName) => {
|
|
1148
|
+
Object.defineProperty(obj, methodName + accessorName, {
|
|
1149
|
+
value: /* @__PURE__ */ __name(function(arg1, arg2, arg3) {
|
|
1150
|
+
return this[methodName].call(this, header, arg1, arg2, arg3);
|
|
1151
|
+
}, "value"),
|
|
1152
|
+
configurable: true
|
|
1153
|
+
});
|
|
1154
|
+
});
|
|
1155
|
+
}
|
|
1156
|
+
__name(buildAccessors, "buildAccessors");
|
|
1157
|
+
var AxiosHeaders = class {
|
|
1158
|
+
static {
|
|
1159
|
+
__name(this, "AxiosHeaders");
|
|
1160
|
+
}
|
|
1161
|
+
constructor(headers) {
|
|
1162
|
+
headers && this.set(headers);
|
|
1163
|
+
}
|
|
1164
|
+
set(header, valueOrRewrite, rewrite) {
|
|
1165
|
+
const self2 = this;
|
|
1166
|
+
function setHeader(_value, _header, _rewrite) {
|
|
1167
|
+
const lHeader = normalizeHeader(_header);
|
|
1168
|
+
if (!lHeader) {
|
|
1169
|
+
throw new Error("header name must be a non-empty string");
|
|
1170
|
+
}
|
|
1171
|
+
const key = utils$1.findKey(self2, lHeader);
|
|
1172
|
+
if (!key || self2[key] === void 0 || _rewrite === true || _rewrite === void 0 && self2[key] !== false) {
|
|
1173
|
+
self2[key || _header] = normalizeValue(_value);
|
|
1174
|
+
}
|
|
1175
|
+
}
|
|
1176
|
+
__name(setHeader, "setHeader");
|
|
1177
|
+
const setHeaders = /* @__PURE__ */ __name((headers, _rewrite) => utils$1.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite)), "setHeaders");
|
|
1178
|
+
if (utils$1.isPlainObject(header) || header instanceof this.constructor) {
|
|
1179
|
+
setHeaders(header, valueOrRewrite);
|
|
1180
|
+
} else if (utils$1.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
|
|
1181
|
+
setHeaders(parseHeaders(header), valueOrRewrite);
|
|
1182
|
+
} else if (utils$1.isObject(header) && utils$1.isIterable(header)) {
|
|
1183
|
+
let obj = {}, dest, key;
|
|
1184
|
+
for (const entry of header) {
|
|
1185
|
+
if (!utils$1.isArray(entry)) {
|
|
1186
|
+
throw TypeError("Object iterator must return a key-value pair");
|
|
1187
|
+
}
|
|
1188
|
+
obj[key = entry[0]] = (dest = obj[key]) ? utils$1.isArray(dest) ? [...dest, entry[1]] : [dest, entry[1]] : entry[1];
|
|
1189
|
+
}
|
|
1190
|
+
setHeaders(obj, valueOrRewrite);
|
|
1191
|
+
} else {
|
|
1192
|
+
header != null && setHeader(valueOrRewrite, header, rewrite);
|
|
1193
|
+
}
|
|
1194
|
+
return this;
|
|
1195
|
+
}
|
|
1196
|
+
get(header, parser) {
|
|
1197
|
+
header = normalizeHeader(header);
|
|
1198
|
+
if (header) {
|
|
1199
|
+
const key = utils$1.findKey(this, header);
|
|
1200
|
+
if (key) {
|
|
1201
|
+
const value = this[key];
|
|
1202
|
+
if (!parser) {
|
|
1203
|
+
return value;
|
|
1204
|
+
}
|
|
1205
|
+
if (parser === true) {
|
|
1206
|
+
return parseTokens(value);
|
|
1207
|
+
}
|
|
1208
|
+
if (utils$1.isFunction(parser)) {
|
|
1209
|
+
return parser.call(this, value, key);
|
|
1210
|
+
}
|
|
1211
|
+
if (utils$1.isRegExp(parser)) {
|
|
1212
|
+
return parser.exec(value);
|
|
1213
|
+
}
|
|
1214
|
+
throw new TypeError("parser must be boolean|regexp|function");
|
|
1215
|
+
}
|
|
1216
|
+
}
|
|
1217
|
+
}
|
|
1218
|
+
has(header, matcher) {
|
|
1219
|
+
header = normalizeHeader(header);
|
|
1220
|
+
if (header) {
|
|
1221
|
+
const key = utils$1.findKey(this, header);
|
|
1222
|
+
return !!(key && this[key] !== void 0 && (!matcher || matchHeaderValue(this, this[key], key, matcher)));
|
|
1223
|
+
}
|
|
1224
|
+
return false;
|
|
1225
|
+
}
|
|
1226
|
+
delete(header, matcher) {
|
|
1227
|
+
const self2 = this;
|
|
1228
|
+
let deleted = false;
|
|
1229
|
+
function deleteHeader(_header) {
|
|
1230
|
+
_header = normalizeHeader(_header);
|
|
1231
|
+
if (_header) {
|
|
1232
|
+
const key = utils$1.findKey(self2, _header);
|
|
1233
|
+
if (key && (!matcher || matchHeaderValue(self2, self2[key], key, matcher))) {
|
|
1234
|
+
delete self2[key];
|
|
1235
|
+
deleted = true;
|
|
1236
|
+
}
|
|
1237
|
+
}
|
|
1238
|
+
}
|
|
1239
|
+
__name(deleteHeader, "deleteHeader");
|
|
1240
|
+
if (utils$1.isArray(header)) {
|
|
1241
|
+
header.forEach(deleteHeader);
|
|
1242
|
+
} else {
|
|
1243
|
+
deleteHeader(header);
|
|
1244
|
+
}
|
|
1245
|
+
return deleted;
|
|
1246
|
+
}
|
|
1247
|
+
clear(matcher) {
|
|
1248
|
+
const keys = Object.keys(this);
|
|
1249
|
+
let i = keys.length;
|
|
1250
|
+
let deleted = false;
|
|
1251
|
+
while (i--) {
|
|
1252
|
+
const key = keys[i];
|
|
1253
|
+
if (!matcher || matchHeaderValue(this, this[key], key, matcher, true)) {
|
|
1254
|
+
delete this[key];
|
|
1255
|
+
deleted = true;
|
|
1256
|
+
}
|
|
1257
|
+
}
|
|
1258
|
+
return deleted;
|
|
1259
|
+
}
|
|
1260
|
+
normalize(format) {
|
|
1261
|
+
const self2 = this;
|
|
1262
|
+
const headers = {};
|
|
1263
|
+
utils$1.forEach(this, (value, header) => {
|
|
1264
|
+
const key = utils$1.findKey(headers, header);
|
|
1265
|
+
if (key) {
|
|
1266
|
+
self2[key] = normalizeValue(value);
|
|
1267
|
+
delete self2[header];
|
|
1268
|
+
return;
|
|
1269
|
+
}
|
|
1270
|
+
const normalized = format ? formatHeader(header) : String(header).trim();
|
|
1271
|
+
if (normalized !== header) {
|
|
1272
|
+
delete self2[header];
|
|
1273
|
+
}
|
|
1274
|
+
self2[normalized] = normalizeValue(value);
|
|
1275
|
+
headers[normalized] = true;
|
|
1276
|
+
});
|
|
1277
|
+
return this;
|
|
1278
|
+
}
|
|
1279
|
+
concat(...targets) {
|
|
1280
|
+
return this.constructor.concat(this, ...targets);
|
|
1281
|
+
}
|
|
1282
|
+
toJSON(asStrings) {
|
|
1283
|
+
const obj = /* @__PURE__ */ Object.create(null);
|
|
1284
|
+
utils$1.forEach(this, (value, header) => {
|
|
1285
|
+
value != null && value !== false && (obj[header] = asStrings && utils$1.isArray(value) ? value.join(", ") : value);
|
|
1286
|
+
});
|
|
1287
|
+
return obj;
|
|
1288
|
+
}
|
|
1289
|
+
[Symbol.iterator]() {
|
|
1290
|
+
return Object.entries(this.toJSON())[Symbol.iterator]();
|
|
1291
|
+
}
|
|
1292
|
+
toString() {
|
|
1293
|
+
return Object.entries(this.toJSON()).map(([header, value]) => header + ": " + value).join("\n");
|
|
1294
|
+
}
|
|
1295
|
+
getSetCookie() {
|
|
1296
|
+
return this.get("set-cookie") || [];
|
|
1297
|
+
}
|
|
1298
|
+
get [Symbol.toStringTag]() {
|
|
1299
|
+
return "AxiosHeaders";
|
|
1300
|
+
}
|
|
1301
|
+
static from(thing) {
|
|
1302
|
+
return thing instanceof this ? thing : new this(thing);
|
|
1303
|
+
}
|
|
1304
|
+
static concat(first, ...targets) {
|
|
1305
|
+
const computed = new this(first);
|
|
1306
|
+
targets.forEach((target) => computed.set(target));
|
|
1307
|
+
return computed;
|
|
1308
|
+
}
|
|
1309
|
+
static accessor(header) {
|
|
1310
|
+
const internals = this[$internals] = this[$internals] = {
|
|
1311
|
+
accessors: {}
|
|
1312
|
+
};
|
|
1313
|
+
const accessors = internals.accessors;
|
|
1314
|
+
const prototype2 = this.prototype;
|
|
1315
|
+
function defineAccessor(_header) {
|
|
1316
|
+
const lHeader = normalizeHeader(_header);
|
|
1317
|
+
if (!accessors[lHeader]) {
|
|
1318
|
+
buildAccessors(prototype2, _header);
|
|
1319
|
+
accessors[lHeader] = true;
|
|
1320
|
+
}
|
|
1321
|
+
}
|
|
1322
|
+
__name(defineAccessor, "defineAccessor");
|
|
1323
|
+
utils$1.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);
|
|
1324
|
+
return this;
|
|
1325
|
+
}
|
|
1326
|
+
};
|
|
1327
|
+
AxiosHeaders.accessor([
|
|
1328
|
+
"Content-Type",
|
|
1329
|
+
"Content-Length",
|
|
1330
|
+
"Accept",
|
|
1331
|
+
"Accept-Encoding",
|
|
1332
|
+
"User-Agent",
|
|
1333
|
+
"Authorization"
|
|
1334
|
+
]);
|
|
1335
|
+
utils$1.reduceDescriptors(AxiosHeaders.prototype, ({ value }, key) => {
|
|
1336
|
+
let mapped = key[0].toUpperCase() + key.slice(1);
|
|
1337
|
+
return {
|
|
1338
|
+
get: /* @__PURE__ */ __name(() => value, "get"),
|
|
1339
|
+
set(headerValue) {
|
|
1340
|
+
this[mapped] = headerValue;
|
|
1341
|
+
}
|
|
1342
|
+
};
|
|
1343
|
+
});
|
|
1344
|
+
utils$1.freezeMethods(AxiosHeaders);
|
|
1345
|
+
var AxiosHeaders$1 = AxiosHeaders;
|
|
1346
|
+
function transformData(fns, response) {
|
|
1347
|
+
const config = this || defaults$1;
|
|
1348
|
+
const context = response || config;
|
|
1349
|
+
const headers = AxiosHeaders$1.from(context.headers);
|
|
1350
|
+
let data = context.data;
|
|
1351
|
+
utils$1.forEach(fns, /* @__PURE__ */ __name(function transform(fn) {
|
|
1352
|
+
data = fn.call(config, data, headers.normalize(), response ? response.status : void 0);
|
|
1353
|
+
}, "transform"));
|
|
1354
|
+
headers.normalize();
|
|
1355
|
+
return data;
|
|
1356
|
+
}
|
|
1357
|
+
__name(transformData, "transformData");
|
|
1358
|
+
function isCancel(value) {
|
|
1359
|
+
return !!(value && value.__CANCEL__);
|
|
1360
|
+
}
|
|
1361
|
+
__name(isCancel, "isCancel");
|
|
1362
|
+
var CanceledError = class extends AxiosError$1 {
|
|
1363
|
+
static {
|
|
1364
|
+
__name(this, "CanceledError");
|
|
1365
|
+
}
|
|
1366
|
+
/**
|
|
1367
|
+
* A `CanceledError` is an object that is thrown when an operation is canceled.
|
|
1368
|
+
*
|
|
1369
|
+
* @param {string=} message The message.
|
|
1370
|
+
* @param {Object=} config The config.
|
|
1371
|
+
* @param {Object=} request The request.
|
|
1372
|
+
*
|
|
1373
|
+
* @returns {CanceledError} The created error.
|
|
1374
|
+
*/
|
|
1375
|
+
constructor(message, config, request) {
|
|
1376
|
+
super(message == null ? "canceled" : message, AxiosError$1.ERR_CANCELED, config, request);
|
|
1377
|
+
this.name = "CanceledError";
|
|
1378
|
+
this.__CANCEL__ = true;
|
|
1379
|
+
}
|
|
1380
|
+
};
|
|
1381
|
+
var CanceledError$1 = CanceledError;
|
|
1382
|
+
function settle(resolve, reject, response) {
|
|
1383
|
+
const validateStatus = response.config.validateStatus;
|
|
1384
|
+
if (!response.status || !validateStatus || validateStatus(response.status)) {
|
|
1385
|
+
resolve(response);
|
|
1386
|
+
} else {
|
|
1387
|
+
reject(
|
|
1388
|
+
new AxiosError$1(
|
|
1389
|
+
"Request failed with status code " + response.status,
|
|
1390
|
+
[AxiosError$1.ERR_BAD_REQUEST, AxiosError$1.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4],
|
|
1391
|
+
response.config,
|
|
1392
|
+
response.request,
|
|
1393
|
+
response
|
|
1394
|
+
)
|
|
1395
|
+
);
|
|
1396
|
+
}
|
|
1397
|
+
}
|
|
1398
|
+
__name(settle, "settle");
|
|
1399
|
+
function isAbsoluteURL(url2) {
|
|
1400
|
+
if (typeof url2 !== "string") {
|
|
1401
|
+
return false;
|
|
1402
|
+
}
|
|
1403
|
+
return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url2);
|
|
1404
|
+
}
|
|
1405
|
+
__name(isAbsoluteURL, "isAbsoluteURL");
|
|
1406
|
+
function combineURLs(baseURL, relativeURL) {
|
|
1407
|
+
return relativeURL ? baseURL.replace(/\/?\/$/, "") + "/" + relativeURL.replace(/^\/+/, "") : baseURL;
|
|
1408
|
+
}
|
|
1409
|
+
__name(combineURLs, "combineURLs");
|
|
1410
|
+
function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls) {
|
|
1411
|
+
let isRelativeUrl = !isAbsoluteURL(requestedURL);
|
|
1412
|
+
if (baseURL && (isRelativeUrl || allowAbsoluteUrls == false)) {
|
|
1413
|
+
return combineURLs(baseURL, requestedURL);
|
|
1414
|
+
}
|
|
1415
|
+
return requestedURL;
|
|
1416
|
+
}
|
|
1417
|
+
__name(buildFullPath, "buildFullPath");
|
|
1418
|
+
var VERSION = "1.13.6";
|
|
1419
|
+
function parseProtocol(url2) {
|
|
1420
|
+
const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url2);
|
|
1421
|
+
return match && match[1] || "";
|
|
1422
|
+
}
|
|
1423
|
+
__name(parseProtocol, "parseProtocol");
|
|
1424
|
+
var DATA_URL_PATTERN = /^(?:([^;]+);)?(?:[^;]+;)?(base64|),([\s\S]*)$/;
|
|
1425
|
+
function fromDataURI(uri, asBlob, options) {
|
|
1426
|
+
const _Blob = options && options.Blob || platform.classes.Blob;
|
|
1427
|
+
const protocol = parseProtocol(uri);
|
|
1428
|
+
if (asBlob === void 0 && _Blob) {
|
|
1429
|
+
asBlob = true;
|
|
1430
|
+
}
|
|
1431
|
+
if (protocol === "data") {
|
|
1432
|
+
uri = protocol.length ? uri.slice(protocol.length + 1) : uri;
|
|
1433
|
+
const match = DATA_URL_PATTERN.exec(uri);
|
|
1434
|
+
if (!match) {
|
|
1435
|
+
throw new AxiosError$1("Invalid URL", AxiosError$1.ERR_INVALID_URL);
|
|
1436
|
+
}
|
|
1437
|
+
const mime = match[1];
|
|
1438
|
+
const isBase64 = match[2];
|
|
1439
|
+
const body = match[3];
|
|
1440
|
+
const buffer = Buffer.from(decodeURIComponent(body), isBase64 ? "base64" : "utf8");
|
|
1441
|
+
if (asBlob) {
|
|
1442
|
+
if (!_Blob) {
|
|
1443
|
+
throw new AxiosError$1("Blob is not supported", AxiosError$1.ERR_NOT_SUPPORT);
|
|
1444
|
+
}
|
|
1445
|
+
return new _Blob([buffer], { type: mime });
|
|
1446
|
+
}
|
|
1447
|
+
return buffer;
|
|
1448
|
+
}
|
|
1449
|
+
throw new AxiosError$1("Unsupported protocol " + protocol, AxiosError$1.ERR_NOT_SUPPORT);
|
|
1450
|
+
}
|
|
1451
|
+
__name(fromDataURI, "fromDataURI");
|
|
1452
|
+
var kInternals = Symbol("internals");
|
|
1453
|
+
var AxiosTransformStream = class extends stream__default["default"].Transform {
|
|
1454
|
+
static {
|
|
1455
|
+
__name(this, "AxiosTransformStream");
|
|
1456
|
+
}
|
|
1457
|
+
constructor(options) {
|
|
1458
|
+
options = utils$1.toFlatObject(
|
|
1459
|
+
options,
|
|
1460
|
+
{
|
|
1461
|
+
maxRate: 0,
|
|
1462
|
+
chunkSize: 64 * 1024,
|
|
1463
|
+
minChunkSize: 100,
|
|
1464
|
+
timeWindow: 500,
|
|
1465
|
+
ticksRate: 2,
|
|
1466
|
+
samplesCount: 15
|
|
1467
|
+
},
|
|
1468
|
+
null,
|
|
1469
|
+
(prop, source) => {
|
|
1470
|
+
return !utils$1.isUndefined(source[prop]);
|
|
1471
|
+
}
|
|
1472
|
+
);
|
|
1473
|
+
super({
|
|
1474
|
+
readableHighWaterMark: options.chunkSize
|
|
1475
|
+
});
|
|
1476
|
+
const internals = this[kInternals] = {
|
|
1477
|
+
timeWindow: options.timeWindow,
|
|
1478
|
+
chunkSize: options.chunkSize,
|
|
1479
|
+
maxRate: options.maxRate,
|
|
1480
|
+
minChunkSize: options.minChunkSize,
|
|
1481
|
+
bytesSeen: 0,
|
|
1482
|
+
isCaptured: false,
|
|
1483
|
+
notifiedBytesLoaded: 0,
|
|
1484
|
+
ts: Date.now(),
|
|
1485
|
+
bytes: 0,
|
|
1486
|
+
onReadCallback: null
|
|
1487
|
+
};
|
|
1488
|
+
this.on("newListener", (event) => {
|
|
1489
|
+
if (event === "progress") {
|
|
1490
|
+
if (!internals.isCaptured) {
|
|
1491
|
+
internals.isCaptured = true;
|
|
1492
|
+
}
|
|
1493
|
+
}
|
|
1494
|
+
});
|
|
1495
|
+
}
|
|
1496
|
+
_read(size) {
|
|
1497
|
+
const internals = this[kInternals];
|
|
1498
|
+
if (internals.onReadCallback) {
|
|
1499
|
+
internals.onReadCallback();
|
|
1500
|
+
}
|
|
1501
|
+
return super._read(size);
|
|
1502
|
+
}
|
|
1503
|
+
_transform(chunk, encoding, callback) {
|
|
1504
|
+
const internals = this[kInternals];
|
|
1505
|
+
const maxRate = internals.maxRate;
|
|
1506
|
+
const readableHighWaterMark = this.readableHighWaterMark;
|
|
1507
|
+
const timeWindow = internals.timeWindow;
|
|
1508
|
+
const divider = 1e3 / timeWindow;
|
|
1509
|
+
const bytesThreshold = maxRate / divider;
|
|
1510
|
+
const minChunkSize = internals.minChunkSize !== false ? Math.max(internals.minChunkSize, bytesThreshold * 0.01) : 0;
|
|
1511
|
+
const pushChunk = /* @__PURE__ */ __name((_chunk, _callback) => {
|
|
1512
|
+
const bytes = Buffer.byteLength(_chunk);
|
|
1513
|
+
internals.bytesSeen += bytes;
|
|
1514
|
+
internals.bytes += bytes;
|
|
1515
|
+
internals.isCaptured && this.emit("progress", internals.bytesSeen);
|
|
1516
|
+
if (this.push(_chunk)) {
|
|
1517
|
+
process.nextTick(_callback);
|
|
1518
|
+
} else {
|
|
1519
|
+
internals.onReadCallback = () => {
|
|
1520
|
+
internals.onReadCallback = null;
|
|
1521
|
+
process.nextTick(_callback);
|
|
1522
|
+
};
|
|
1523
|
+
}
|
|
1524
|
+
}, "pushChunk");
|
|
1525
|
+
const transformChunk = /* @__PURE__ */ __name((_chunk, _callback) => {
|
|
1526
|
+
const chunkSize = Buffer.byteLength(_chunk);
|
|
1527
|
+
let chunkRemainder = null;
|
|
1528
|
+
let maxChunkSize = readableHighWaterMark;
|
|
1529
|
+
let bytesLeft;
|
|
1530
|
+
let passed = 0;
|
|
1531
|
+
if (maxRate) {
|
|
1532
|
+
const now = Date.now();
|
|
1533
|
+
if (!internals.ts || (passed = now - internals.ts) >= timeWindow) {
|
|
1534
|
+
internals.ts = now;
|
|
1535
|
+
bytesLeft = bytesThreshold - internals.bytes;
|
|
1536
|
+
internals.bytes = bytesLeft < 0 ? -bytesLeft : 0;
|
|
1537
|
+
passed = 0;
|
|
1538
|
+
}
|
|
1539
|
+
bytesLeft = bytesThreshold - internals.bytes;
|
|
1540
|
+
}
|
|
1541
|
+
if (maxRate) {
|
|
1542
|
+
if (bytesLeft <= 0) {
|
|
1543
|
+
return setTimeout(() => {
|
|
1544
|
+
_callback(null, _chunk);
|
|
1545
|
+
}, timeWindow - passed);
|
|
1546
|
+
}
|
|
1547
|
+
if (bytesLeft < maxChunkSize) {
|
|
1548
|
+
maxChunkSize = bytesLeft;
|
|
1549
|
+
}
|
|
1550
|
+
}
|
|
1551
|
+
if (maxChunkSize && chunkSize > maxChunkSize && chunkSize - maxChunkSize > minChunkSize) {
|
|
1552
|
+
chunkRemainder = _chunk.subarray(maxChunkSize);
|
|
1553
|
+
_chunk = _chunk.subarray(0, maxChunkSize);
|
|
1554
|
+
}
|
|
1555
|
+
pushChunk(
|
|
1556
|
+
_chunk,
|
|
1557
|
+
chunkRemainder ? () => {
|
|
1558
|
+
process.nextTick(_callback, null, chunkRemainder);
|
|
1559
|
+
} : _callback
|
|
1560
|
+
);
|
|
1561
|
+
}, "transformChunk");
|
|
1562
|
+
transformChunk(chunk, /* @__PURE__ */ __name(function transformNextChunk(err, _chunk) {
|
|
1563
|
+
if (err) {
|
|
1564
|
+
return callback(err);
|
|
1565
|
+
}
|
|
1566
|
+
if (_chunk) {
|
|
1567
|
+
transformChunk(_chunk, transformNextChunk);
|
|
1568
|
+
} else {
|
|
1569
|
+
callback(null);
|
|
1570
|
+
}
|
|
1571
|
+
}, "transformNextChunk"));
|
|
1572
|
+
}
|
|
1573
|
+
};
|
|
1574
|
+
var AxiosTransformStream$1 = AxiosTransformStream;
|
|
1575
|
+
var { asyncIterator } = Symbol;
|
|
1576
|
+
var readBlob = /* @__PURE__ */ __name(async function* (blob) {
|
|
1577
|
+
if (blob.stream) {
|
|
1578
|
+
yield* blob.stream();
|
|
1579
|
+
} else if (blob.arrayBuffer) {
|
|
1580
|
+
yield await blob.arrayBuffer();
|
|
1581
|
+
} else if (blob[asyncIterator]) {
|
|
1582
|
+
yield* blob[asyncIterator]();
|
|
1583
|
+
} else {
|
|
1584
|
+
yield blob;
|
|
1585
|
+
}
|
|
1586
|
+
}, "readBlob");
|
|
1587
|
+
var readBlob$1 = readBlob;
|
|
1588
|
+
var BOUNDARY_ALPHABET = platform.ALPHABET.ALPHA_DIGIT + "-_";
|
|
1589
|
+
var textEncoder = typeof TextEncoder === "function" ? new TextEncoder() : new util__default["default"].TextEncoder();
|
|
1590
|
+
var CRLF = "\r\n";
|
|
1591
|
+
var CRLF_BYTES = textEncoder.encode(CRLF);
|
|
1592
|
+
var CRLF_BYTES_COUNT = 2;
|
|
1593
|
+
var FormDataPart = class {
|
|
1594
|
+
static {
|
|
1595
|
+
__name(this, "FormDataPart");
|
|
1596
|
+
}
|
|
1597
|
+
constructor(name, value) {
|
|
1598
|
+
const { escapeName } = this.constructor;
|
|
1599
|
+
const isStringValue = utils$1.isString(value);
|
|
1600
|
+
let headers = `Content-Disposition: form-data; name="${escapeName(name)}"${!isStringValue && value.name ? `; filename="${escapeName(value.name)}"` : ""}${CRLF}`;
|
|
1601
|
+
if (isStringValue) {
|
|
1602
|
+
value = textEncoder.encode(String(value).replace(/\r?\n|\r\n?/g, CRLF));
|
|
1603
|
+
} else {
|
|
1604
|
+
headers += `Content-Type: ${value.type || "application/octet-stream"}${CRLF}`;
|
|
1605
|
+
}
|
|
1606
|
+
this.headers = textEncoder.encode(headers + CRLF);
|
|
1607
|
+
this.contentLength = isStringValue ? value.byteLength : value.size;
|
|
1608
|
+
this.size = this.headers.byteLength + this.contentLength + CRLF_BYTES_COUNT;
|
|
1609
|
+
this.name = name;
|
|
1610
|
+
this.value = value;
|
|
1611
|
+
}
|
|
1612
|
+
async *encode() {
|
|
1613
|
+
yield this.headers;
|
|
1614
|
+
const { value } = this;
|
|
1615
|
+
if (utils$1.isTypedArray(value)) {
|
|
1616
|
+
yield value;
|
|
1617
|
+
} else {
|
|
1618
|
+
yield* readBlob$1(value);
|
|
1619
|
+
}
|
|
1620
|
+
yield CRLF_BYTES;
|
|
1621
|
+
}
|
|
1622
|
+
static escapeName(name) {
|
|
1623
|
+
return String(name).replace(
|
|
1624
|
+
/[\r\n"]/g,
|
|
1625
|
+
(match) => ({
|
|
1626
|
+
"\r": "%0D",
|
|
1627
|
+
"\n": "%0A",
|
|
1628
|
+
'"': "%22"
|
|
1629
|
+
})[match]
|
|
1630
|
+
);
|
|
1631
|
+
}
|
|
1632
|
+
};
|
|
1633
|
+
var formDataToStream = /* @__PURE__ */ __name((form, headersHandler, options) => {
|
|
1634
|
+
const {
|
|
1635
|
+
tag = "form-data-boundary",
|
|
1636
|
+
size = 25,
|
|
1637
|
+
boundary = tag + "-" + platform.generateString(size, BOUNDARY_ALPHABET)
|
|
1638
|
+
} = options || {};
|
|
1639
|
+
if (!utils$1.isFormData(form)) {
|
|
1640
|
+
throw TypeError("FormData instance required");
|
|
1641
|
+
}
|
|
1642
|
+
if (boundary.length < 1 || boundary.length > 70) {
|
|
1643
|
+
throw Error("boundary must be 10-70 characters long");
|
|
1644
|
+
}
|
|
1645
|
+
const boundaryBytes = textEncoder.encode("--" + boundary + CRLF);
|
|
1646
|
+
const footerBytes = textEncoder.encode("--" + boundary + "--" + CRLF);
|
|
1647
|
+
let contentLength = footerBytes.byteLength;
|
|
1648
|
+
const parts = Array.from(form.entries()).map(([name, value]) => {
|
|
1649
|
+
const part = new FormDataPart(name, value);
|
|
1650
|
+
contentLength += part.size;
|
|
1651
|
+
return part;
|
|
1652
|
+
});
|
|
1653
|
+
contentLength += boundaryBytes.byteLength * parts.length;
|
|
1654
|
+
contentLength = utils$1.toFiniteNumber(contentLength);
|
|
1655
|
+
const computedHeaders = {
|
|
1656
|
+
"Content-Type": `multipart/form-data; boundary=${boundary}`
|
|
1657
|
+
};
|
|
1658
|
+
if (Number.isFinite(contentLength)) {
|
|
1659
|
+
computedHeaders["Content-Length"] = contentLength;
|
|
1660
|
+
}
|
|
1661
|
+
headersHandler && headersHandler(computedHeaders);
|
|
1662
|
+
return stream.Readable.from(
|
|
1663
|
+
async function* () {
|
|
1664
|
+
for (const part of parts) {
|
|
1665
|
+
yield boundaryBytes;
|
|
1666
|
+
yield* part.encode();
|
|
1667
|
+
}
|
|
1668
|
+
yield footerBytes;
|
|
1669
|
+
}()
|
|
1670
|
+
);
|
|
1671
|
+
}, "formDataToStream");
|
|
1672
|
+
var formDataToStream$1 = formDataToStream;
|
|
1673
|
+
var ZlibHeaderTransformStream = class extends stream__default["default"].Transform {
|
|
1674
|
+
static {
|
|
1675
|
+
__name(this, "ZlibHeaderTransformStream");
|
|
1676
|
+
}
|
|
1677
|
+
__transform(chunk, encoding, callback) {
|
|
1678
|
+
this.push(chunk);
|
|
1679
|
+
callback();
|
|
1680
|
+
}
|
|
1681
|
+
_transform(chunk, encoding, callback) {
|
|
1682
|
+
if (chunk.length !== 0) {
|
|
1683
|
+
this._transform = this.__transform;
|
|
1684
|
+
if (chunk[0] !== 120) {
|
|
1685
|
+
const header = Buffer.alloc(2);
|
|
1686
|
+
header[0] = 120;
|
|
1687
|
+
header[1] = 156;
|
|
1688
|
+
this.push(header, encoding);
|
|
1689
|
+
}
|
|
1690
|
+
}
|
|
1691
|
+
this.__transform(chunk, encoding, callback);
|
|
1692
|
+
}
|
|
1693
|
+
};
|
|
1694
|
+
var ZlibHeaderTransformStream$1 = ZlibHeaderTransformStream;
|
|
1695
|
+
var callbackify = /* @__PURE__ */ __name((fn, reducer) => {
|
|
1696
|
+
return utils$1.isAsyncFn(fn) ? function(...args) {
|
|
1697
|
+
const cb = args.pop();
|
|
1698
|
+
fn.apply(this, args).then((value) => {
|
|
1699
|
+
try {
|
|
1700
|
+
reducer ? cb(null, ...reducer(value)) : cb(null, value);
|
|
1701
|
+
} catch (err) {
|
|
1702
|
+
cb(err);
|
|
1703
|
+
}
|
|
1704
|
+
}, cb);
|
|
1705
|
+
} : fn;
|
|
1706
|
+
}, "callbackify");
|
|
1707
|
+
var callbackify$1 = callbackify;
|
|
1708
|
+
function speedometer(samplesCount, min) {
|
|
1709
|
+
samplesCount = samplesCount || 10;
|
|
1710
|
+
const bytes = new Array(samplesCount);
|
|
1711
|
+
const timestamps = new Array(samplesCount);
|
|
1712
|
+
let head = 0;
|
|
1713
|
+
let tail = 0;
|
|
1714
|
+
let firstSampleTS;
|
|
1715
|
+
min = min !== void 0 ? min : 1e3;
|
|
1716
|
+
return /* @__PURE__ */ __name(function push(chunkLength) {
|
|
1717
|
+
const now = Date.now();
|
|
1718
|
+
const startedAt = timestamps[tail];
|
|
1719
|
+
if (!firstSampleTS) {
|
|
1720
|
+
firstSampleTS = now;
|
|
1721
|
+
}
|
|
1722
|
+
bytes[head] = chunkLength;
|
|
1723
|
+
timestamps[head] = now;
|
|
1724
|
+
let i = tail;
|
|
1725
|
+
let bytesCount = 0;
|
|
1726
|
+
while (i !== head) {
|
|
1727
|
+
bytesCount += bytes[i++];
|
|
1728
|
+
i = i % samplesCount;
|
|
1729
|
+
}
|
|
1730
|
+
head = (head + 1) % samplesCount;
|
|
1731
|
+
if (head === tail) {
|
|
1732
|
+
tail = (tail + 1) % samplesCount;
|
|
1733
|
+
}
|
|
1734
|
+
if (now - firstSampleTS < min) {
|
|
1735
|
+
return;
|
|
1736
|
+
}
|
|
1737
|
+
const passed = startedAt && now - startedAt;
|
|
1738
|
+
return passed ? Math.round(bytesCount * 1e3 / passed) : void 0;
|
|
1739
|
+
}, "push");
|
|
1740
|
+
}
|
|
1741
|
+
__name(speedometer, "speedometer");
|
|
1742
|
+
function throttle(fn, freq) {
|
|
1743
|
+
let timestamp = 0;
|
|
1744
|
+
let threshold = 1e3 / freq;
|
|
1745
|
+
let lastArgs;
|
|
1746
|
+
let timer;
|
|
1747
|
+
const invoke = /* @__PURE__ */ __name((args, now = Date.now()) => {
|
|
1748
|
+
timestamp = now;
|
|
1749
|
+
lastArgs = null;
|
|
1750
|
+
if (timer) {
|
|
1751
|
+
clearTimeout(timer);
|
|
1752
|
+
timer = null;
|
|
1753
|
+
}
|
|
1754
|
+
fn(...args);
|
|
1755
|
+
}, "invoke");
|
|
1756
|
+
const throttled = /* @__PURE__ */ __name((...args) => {
|
|
1757
|
+
const now = Date.now();
|
|
1758
|
+
const passed = now - timestamp;
|
|
1759
|
+
if (passed >= threshold) {
|
|
1760
|
+
invoke(args, now);
|
|
1761
|
+
} else {
|
|
1762
|
+
lastArgs = args;
|
|
1763
|
+
if (!timer) {
|
|
1764
|
+
timer = setTimeout(() => {
|
|
1765
|
+
timer = null;
|
|
1766
|
+
invoke(lastArgs);
|
|
1767
|
+
}, threshold - passed);
|
|
1768
|
+
}
|
|
1769
|
+
}
|
|
1770
|
+
}, "throttled");
|
|
1771
|
+
const flush = /* @__PURE__ */ __name(() => lastArgs && invoke(lastArgs), "flush");
|
|
1772
|
+
return [throttled, flush];
|
|
1773
|
+
}
|
|
1774
|
+
__name(throttle, "throttle");
|
|
1775
|
+
var progressEventReducer = /* @__PURE__ */ __name((listener, isDownloadStream, freq = 3) => {
|
|
1776
|
+
let bytesNotified = 0;
|
|
1777
|
+
const _speedometer = speedometer(50, 250);
|
|
1778
|
+
return throttle((e) => {
|
|
1779
|
+
const loaded = e.loaded;
|
|
1780
|
+
const total = e.lengthComputable ? e.total : void 0;
|
|
1781
|
+
const progressBytes = loaded - bytesNotified;
|
|
1782
|
+
const rate = _speedometer(progressBytes);
|
|
1783
|
+
const inRange = loaded <= total;
|
|
1784
|
+
bytesNotified = loaded;
|
|
1785
|
+
const data = {
|
|
1786
|
+
loaded,
|
|
1787
|
+
total,
|
|
1788
|
+
progress: total ? loaded / total : void 0,
|
|
1789
|
+
bytes: progressBytes,
|
|
1790
|
+
rate: rate ? rate : void 0,
|
|
1791
|
+
estimated: rate && total && inRange ? (total - loaded) / rate : void 0,
|
|
1792
|
+
event: e,
|
|
1793
|
+
lengthComputable: total != null,
|
|
1794
|
+
[isDownloadStream ? "download" : "upload"]: true
|
|
1795
|
+
};
|
|
1796
|
+
listener(data);
|
|
1797
|
+
}, freq);
|
|
1798
|
+
}, "progressEventReducer");
|
|
1799
|
+
var progressEventDecorator = /* @__PURE__ */ __name((total, throttled) => {
|
|
1800
|
+
const lengthComputable = total != null;
|
|
1801
|
+
return [
|
|
1802
|
+
(loaded) => throttled[0]({
|
|
1803
|
+
lengthComputable,
|
|
1804
|
+
total,
|
|
1805
|
+
loaded
|
|
1806
|
+
}),
|
|
1807
|
+
throttled[1]
|
|
1808
|
+
];
|
|
1809
|
+
}, "progressEventDecorator");
|
|
1810
|
+
var asyncDecorator = /* @__PURE__ */ __name((fn) => (...args) => utils$1.asap(() => fn(...args)), "asyncDecorator");
|
|
1811
|
+
function estimateDataURLDecodedBytes(url2) {
|
|
1812
|
+
if (!url2 || typeof url2 !== "string") return 0;
|
|
1813
|
+
if (!url2.startsWith("data:")) return 0;
|
|
1814
|
+
const comma = url2.indexOf(",");
|
|
1815
|
+
if (comma < 0) return 0;
|
|
1816
|
+
const meta = url2.slice(5, comma);
|
|
1817
|
+
const body = url2.slice(comma + 1);
|
|
1818
|
+
const isBase64 = /;base64/i.test(meta);
|
|
1819
|
+
if (isBase64) {
|
|
1820
|
+
let effectiveLen = body.length;
|
|
1821
|
+
const len = body.length;
|
|
1822
|
+
for (let i = 0; i < len; i++) {
|
|
1823
|
+
if (body.charCodeAt(i) === 37 && i + 2 < len) {
|
|
1824
|
+
const a = body.charCodeAt(i + 1);
|
|
1825
|
+
const b = body.charCodeAt(i + 2);
|
|
1826
|
+
const isHex = (a >= 48 && a <= 57 || a >= 65 && a <= 70 || a >= 97 && a <= 102) && (b >= 48 && b <= 57 || b >= 65 && b <= 70 || b >= 97 && b <= 102);
|
|
1827
|
+
if (isHex) {
|
|
1828
|
+
effectiveLen -= 2;
|
|
1829
|
+
i += 2;
|
|
1830
|
+
}
|
|
1831
|
+
}
|
|
1832
|
+
}
|
|
1833
|
+
let pad = 0;
|
|
1834
|
+
let idx = len - 1;
|
|
1835
|
+
const tailIsPct3D = /* @__PURE__ */ __name((j) => j >= 2 && body.charCodeAt(j - 2) === 37 && // '%'
|
|
1836
|
+
body.charCodeAt(j - 1) === 51 && // '3'
|
|
1837
|
+
(body.charCodeAt(j) === 68 || body.charCodeAt(j) === 100), "tailIsPct3D");
|
|
1838
|
+
if (idx >= 0) {
|
|
1839
|
+
if (body.charCodeAt(idx) === 61) {
|
|
1840
|
+
pad++;
|
|
1841
|
+
idx--;
|
|
1842
|
+
} else if (tailIsPct3D(idx)) {
|
|
1843
|
+
pad++;
|
|
1844
|
+
idx -= 3;
|
|
1845
|
+
}
|
|
1846
|
+
}
|
|
1847
|
+
if (pad === 1 && idx >= 0) {
|
|
1848
|
+
if (body.charCodeAt(idx) === 61) {
|
|
1849
|
+
pad++;
|
|
1850
|
+
} else if (tailIsPct3D(idx)) {
|
|
1851
|
+
pad++;
|
|
1852
|
+
}
|
|
1853
|
+
}
|
|
1854
|
+
const groups = Math.floor(effectiveLen / 4);
|
|
1855
|
+
const bytes = groups * 3 - (pad || 0);
|
|
1856
|
+
return bytes > 0 ? bytes : 0;
|
|
1857
|
+
}
|
|
1858
|
+
return Buffer.byteLength(body, "utf8");
|
|
1859
|
+
}
|
|
1860
|
+
__name(estimateDataURLDecodedBytes, "estimateDataURLDecodedBytes");
|
|
1861
|
+
var zlibOptions = {
|
|
1862
|
+
flush: zlib__default["default"].constants.Z_SYNC_FLUSH,
|
|
1863
|
+
finishFlush: zlib__default["default"].constants.Z_SYNC_FLUSH
|
|
1864
|
+
};
|
|
1865
|
+
var brotliOptions = {
|
|
1866
|
+
flush: zlib__default["default"].constants.BROTLI_OPERATION_FLUSH,
|
|
1867
|
+
finishFlush: zlib__default["default"].constants.BROTLI_OPERATION_FLUSH
|
|
1868
|
+
};
|
|
1869
|
+
var isBrotliSupported = utils$1.isFunction(zlib__default["default"].createBrotliDecompress);
|
|
1870
|
+
var { http: httpFollow, https: httpsFollow } = followRedirects__default["default"];
|
|
1871
|
+
var isHttps = /https:?/;
|
|
1872
|
+
var supportedProtocols = platform.protocols.map((protocol) => {
|
|
1873
|
+
return protocol + ":";
|
|
1874
|
+
});
|
|
1875
|
+
var flushOnFinish = /* @__PURE__ */ __name((stream2, [throttled, flush]) => {
|
|
1876
|
+
stream2.on("end", flush).on("error", flush);
|
|
1877
|
+
return throttled;
|
|
1878
|
+
}, "flushOnFinish");
|
|
1879
|
+
var Http2Sessions = class {
|
|
1880
|
+
static {
|
|
1881
|
+
__name(this, "Http2Sessions");
|
|
1882
|
+
}
|
|
1883
|
+
constructor() {
|
|
1884
|
+
this.sessions = /* @__PURE__ */ Object.create(null);
|
|
1885
|
+
}
|
|
1886
|
+
getSession(authority, options) {
|
|
1887
|
+
options = Object.assign(
|
|
1888
|
+
{
|
|
1889
|
+
sessionTimeout: 1e3
|
|
1890
|
+
},
|
|
1891
|
+
options
|
|
1892
|
+
);
|
|
1893
|
+
let authoritySessions = this.sessions[authority];
|
|
1894
|
+
if (authoritySessions) {
|
|
1895
|
+
let len = authoritySessions.length;
|
|
1896
|
+
for (let i = 0; i < len; i++) {
|
|
1897
|
+
const [sessionHandle, sessionOptions] = authoritySessions[i];
|
|
1898
|
+
if (!sessionHandle.destroyed && !sessionHandle.closed && util__default["default"].isDeepStrictEqual(sessionOptions, options)) {
|
|
1899
|
+
return sessionHandle;
|
|
1900
|
+
}
|
|
1901
|
+
}
|
|
1902
|
+
}
|
|
1903
|
+
const session = http2__default["default"].connect(authority, options);
|
|
1904
|
+
let removed;
|
|
1905
|
+
const removeSession = /* @__PURE__ */ __name(() => {
|
|
1906
|
+
if (removed) {
|
|
1907
|
+
return;
|
|
1908
|
+
}
|
|
1909
|
+
removed = true;
|
|
1910
|
+
let entries = authoritySessions, len = entries.length, i = len;
|
|
1911
|
+
while (i--) {
|
|
1912
|
+
if (entries[i][0] === session) {
|
|
1913
|
+
if (len === 1) {
|
|
1914
|
+
delete this.sessions[authority];
|
|
1915
|
+
} else {
|
|
1916
|
+
entries.splice(i, 1);
|
|
1917
|
+
}
|
|
1918
|
+
return;
|
|
1919
|
+
}
|
|
1920
|
+
}
|
|
1921
|
+
}, "removeSession");
|
|
1922
|
+
const originalRequestFn = session.request;
|
|
1923
|
+
const { sessionTimeout } = options;
|
|
1924
|
+
if (sessionTimeout != null) {
|
|
1925
|
+
let timer;
|
|
1926
|
+
let streamsCount = 0;
|
|
1927
|
+
session.request = function() {
|
|
1928
|
+
const stream2 = originalRequestFn.apply(this, arguments);
|
|
1929
|
+
streamsCount++;
|
|
1930
|
+
if (timer) {
|
|
1931
|
+
clearTimeout(timer);
|
|
1932
|
+
timer = null;
|
|
1933
|
+
}
|
|
1934
|
+
stream2.once("close", () => {
|
|
1935
|
+
if (!--streamsCount) {
|
|
1936
|
+
timer = setTimeout(() => {
|
|
1937
|
+
timer = null;
|
|
1938
|
+
removeSession();
|
|
1939
|
+
}, sessionTimeout);
|
|
1940
|
+
}
|
|
1941
|
+
});
|
|
1942
|
+
return stream2;
|
|
1943
|
+
};
|
|
1944
|
+
}
|
|
1945
|
+
session.once("close", removeSession);
|
|
1946
|
+
let entry = [session, options];
|
|
1947
|
+
authoritySessions ? authoritySessions.push(entry) : authoritySessions = this.sessions[authority] = [entry];
|
|
1948
|
+
return session;
|
|
1949
|
+
}
|
|
1950
|
+
};
|
|
1951
|
+
var http2Sessions = new Http2Sessions();
|
|
1952
|
+
function dispatchBeforeRedirect(options, responseDetails) {
|
|
1953
|
+
if (options.beforeRedirects.proxy) {
|
|
1954
|
+
options.beforeRedirects.proxy(options);
|
|
1955
|
+
}
|
|
1956
|
+
if (options.beforeRedirects.config) {
|
|
1957
|
+
options.beforeRedirects.config(options, responseDetails);
|
|
1958
|
+
}
|
|
1959
|
+
}
|
|
1960
|
+
__name(dispatchBeforeRedirect, "dispatchBeforeRedirect");
|
|
1961
|
+
function setProxy(options, configProxy, location) {
|
|
1962
|
+
let proxy = configProxy;
|
|
1963
|
+
if (!proxy && proxy !== false) {
|
|
1964
|
+
const proxyUrl = proxyFromEnv__default["default"].getProxyForUrl(location);
|
|
1965
|
+
if (proxyUrl) {
|
|
1966
|
+
proxy = new URL(proxyUrl);
|
|
1967
|
+
}
|
|
1968
|
+
}
|
|
1969
|
+
if (proxy) {
|
|
1970
|
+
if (proxy.username) {
|
|
1971
|
+
proxy.auth = (proxy.username || "") + ":" + (proxy.password || "");
|
|
1972
|
+
}
|
|
1973
|
+
if (proxy.auth) {
|
|
1974
|
+
const validProxyAuth = Boolean(proxy.auth.username || proxy.auth.password);
|
|
1975
|
+
if (validProxyAuth) {
|
|
1976
|
+
proxy.auth = (proxy.auth.username || "") + ":" + (proxy.auth.password || "");
|
|
1977
|
+
} else if (typeof proxy.auth === "object") {
|
|
1978
|
+
throw new AxiosError$1("Invalid proxy authorization", AxiosError$1.ERR_BAD_OPTION, { proxy });
|
|
1979
|
+
}
|
|
1980
|
+
const base64 = Buffer.from(proxy.auth, "utf8").toString("base64");
|
|
1981
|
+
options.headers["Proxy-Authorization"] = "Basic " + base64;
|
|
1982
|
+
}
|
|
1983
|
+
options.headers.host = options.hostname + (options.port ? ":" + options.port : "");
|
|
1984
|
+
const proxyHost = proxy.hostname || proxy.host;
|
|
1985
|
+
options.hostname = proxyHost;
|
|
1986
|
+
options.host = proxyHost;
|
|
1987
|
+
options.port = proxy.port;
|
|
1988
|
+
options.path = location;
|
|
1989
|
+
if (proxy.protocol) {
|
|
1990
|
+
options.protocol = proxy.protocol.includes(":") ? proxy.protocol : `${proxy.protocol}:`;
|
|
1991
|
+
}
|
|
1992
|
+
}
|
|
1993
|
+
options.beforeRedirects.proxy = /* @__PURE__ */ __name(function beforeRedirect(redirectOptions) {
|
|
1994
|
+
setProxy(redirectOptions, configProxy, redirectOptions.href);
|
|
1995
|
+
}, "beforeRedirect");
|
|
1996
|
+
}
|
|
1997
|
+
__name(setProxy, "setProxy");
|
|
1998
|
+
var isHttpAdapterSupported = typeof process !== "undefined" && utils$1.kindOf(process) === "process";
|
|
1999
|
+
var wrapAsync = /* @__PURE__ */ __name((asyncExecutor) => {
|
|
2000
|
+
return new Promise((resolve, reject) => {
|
|
2001
|
+
let onDone;
|
|
2002
|
+
let isDone;
|
|
2003
|
+
const done = /* @__PURE__ */ __name((value, isRejected) => {
|
|
2004
|
+
if (isDone) return;
|
|
2005
|
+
isDone = true;
|
|
2006
|
+
onDone && onDone(value, isRejected);
|
|
2007
|
+
}, "done");
|
|
2008
|
+
const _resolve = /* @__PURE__ */ __name((value) => {
|
|
2009
|
+
done(value);
|
|
2010
|
+
resolve(value);
|
|
2011
|
+
}, "_resolve");
|
|
2012
|
+
const _reject = /* @__PURE__ */ __name((reason) => {
|
|
2013
|
+
done(reason, true);
|
|
2014
|
+
reject(reason);
|
|
2015
|
+
}, "_reject");
|
|
2016
|
+
asyncExecutor(_resolve, _reject, (onDoneHandler) => onDone = onDoneHandler).catch(_reject);
|
|
2017
|
+
});
|
|
2018
|
+
}, "wrapAsync");
|
|
2019
|
+
var resolveFamily = /* @__PURE__ */ __name(({ address, family }) => {
|
|
2020
|
+
if (!utils$1.isString(address)) {
|
|
2021
|
+
throw TypeError("address must be a string");
|
|
2022
|
+
}
|
|
2023
|
+
return {
|
|
2024
|
+
address,
|
|
2025
|
+
family: family || (address.indexOf(".") < 0 ? 6 : 4)
|
|
2026
|
+
};
|
|
2027
|
+
}, "resolveFamily");
|
|
2028
|
+
var buildAddressEntry = /* @__PURE__ */ __name((address, family) => resolveFamily(utils$1.isObject(address) ? address : { address, family }), "buildAddressEntry");
|
|
2029
|
+
var http2Transport = {
|
|
2030
|
+
request(options, cb) {
|
|
2031
|
+
const authority = options.protocol + "//" + options.hostname + ":" + (options.port || (options.protocol === "https:" ? 443 : 80));
|
|
2032
|
+
const { http2Options, headers } = options;
|
|
2033
|
+
const session = http2Sessions.getSession(authority, http2Options);
|
|
2034
|
+
const { HTTP2_HEADER_SCHEME, HTTP2_HEADER_METHOD, HTTP2_HEADER_PATH, HTTP2_HEADER_STATUS } = http2__default["default"].constants;
|
|
2035
|
+
const http2Headers = {
|
|
2036
|
+
[HTTP2_HEADER_SCHEME]: options.protocol.replace(":", ""),
|
|
2037
|
+
[HTTP2_HEADER_METHOD]: options.method,
|
|
2038
|
+
[HTTP2_HEADER_PATH]: options.path
|
|
2039
|
+
};
|
|
2040
|
+
utils$1.forEach(headers, (header, name) => {
|
|
2041
|
+
name.charAt(0) !== ":" && (http2Headers[name] = header);
|
|
2042
|
+
});
|
|
2043
|
+
const req = session.request(http2Headers);
|
|
2044
|
+
req.once("response", (responseHeaders) => {
|
|
2045
|
+
const response = req;
|
|
2046
|
+
responseHeaders = Object.assign({}, responseHeaders);
|
|
2047
|
+
const status = responseHeaders[HTTP2_HEADER_STATUS];
|
|
2048
|
+
delete responseHeaders[HTTP2_HEADER_STATUS];
|
|
2049
|
+
response.headers = responseHeaders;
|
|
2050
|
+
response.statusCode = +status;
|
|
2051
|
+
cb(response);
|
|
2052
|
+
});
|
|
2053
|
+
return req;
|
|
2054
|
+
}
|
|
2055
|
+
};
|
|
2056
|
+
var httpAdapter = isHttpAdapterSupported && /* @__PURE__ */ __name(function httpAdapter2(config) {
|
|
2057
|
+
return wrapAsync(/* @__PURE__ */ __name(async function dispatchHttpRequest(resolve, reject, onDone) {
|
|
2058
|
+
let { data, lookup, family, httpVersion = 1, http2Options } = config;
|
|
2059
|
+
const { responseType, responseEncoding } = config;
|
|
2060
|
+
const method = config.method.toUpperCase();
|
|
2061
|
+
let isDone;
|
|
2062
|
+
let rejected = false;
|
|
2063
|
+
let req;
|
|
2064
|
+
httpVersion = +httpVersion;
|
|
2065
|
+
if (Number.isNaN(httpVersion)) {
|
|
2066
|
+
throw TypeError(`Invalid protocol version: '${config.httpVersion}' is not a number`);
|
|
2067
|
+
}
|
|
2068
|
+
if (httpVersion !== 1 && httpVersion !== 2) {
|
|
2069
|
+
throw TypeError(`Unsupported protocol version '${httpVersion}'`);
|
|
2070
|
+
}
|
|
2071
|
+
const isHttp2 = httpVersion === 2;
|
|
2072
|
+
if (lookup) {
|
|
2073
|
+
const _lookup = callbackify$1(lookup, (value) => utils$1.isArray(value) ? value : [value]);
|
|
2074
|
+
lookup = /* @__PURE__ */ __name((hostname, opt, cb) => {
|
|
2075
|
+
_lookup(hostname, opt, (err, arg0, arg1) => {
|
|
2076
|
+
if (err) {
|
|
2077
|
+
return cb(err);
|
|
2078
|
+
}
|
|
2079
|
+
const addresses = utils$1.isArray(arg0) ? arg0.map((addr) => buildAddressEntry(addr)) : [buildAddressEntry(arg0, arg1)];
|
|
2080
|
+
opt.all ? cb(err, addresses) : cb(err, addresses[0].address, addresses[0].family);
|
|
2081
|
+
});
|
|
2082
|
+
}, "lookup");
|
|
2083
|
+
}
|
|
2084
|
+
const abortEmitter = new events.EventEmitter();
|
|
2085
|
+
function abort(reason) {
|
|
2086
|
+
try {
|
|
2087
|
+
abortEmitter.emit(
|
|
2088
|
+
"abort",
|
|
2089
|
+
!reason || reason.type ? new CanceledError$1(null, config, req) : reason
|
|
2090
|
+
);
|
|
2091
|
+
} catch (err) {
|
|
2092
|
+
console.warn("emit error", err);
|
|
2093
|
+
}
|
|
2094
|
+
}
|
|
2095
|
+
__name(abort, "abort");
|
|
2096
|
+
abortEmitter.once("abort", reject);
|
|
2097
|
+
const onFinished = /* @__PURE__ */ __name(() => {
|
|
2098
|
+
if (config.cancelToken) {
|
|
2099
|
+
config.cancelToken.unsubscribe(abort);
|
|
2100
|
+
}
|
|
2101
|
+
if (config.signal) {
|
|
2102
|
+
config.signal.removeEventListener("abort", abort);
|
|
2103
|
+
}
|
|
2104
|
+
abortEmitter.removeAllListeners();
|
|
2105
|
+
}, "onFinished");
|
|
2106
|
+
if (config.cancelToken || config.signal) {
|
|
2107
|
+
config.cancelToken && config.cancelToken.subscribe(abort);
|
|
2108
|
+
if (config.signal) {
|
|
2109
|
+
config.signal.aborted ? abort() : config.signal.addEventListener("abort", abort);
|
|
2110
|
+
}
|
|
2111
|
+
}
|
|
2112
|
+
onDone((response, isRejected) => {
|
|
2113
|
+
isDone = true;
|
|
2114
|
+
if (isRejected) {
|
|
2115
|
+
rejected = true;
|
|
2116
|
+
onFinished();
|
|
2117
|
+
return;
|
|
2118
|
+
}
|
|
2119
|
+
const { data: data2 } = response;
|
|
2120
|
+
if (data2 instanceof stream__default["default"].Readable || data2 instanceof stream__default["default"].Duplex) {
|
|
2121
|
+
const offListeners = stream__default["default"].finished(data2, () => {
|
|
2122
|
+
offListeners();
|
|
2123
|
+
onFinished();
|
|
2124
|
+
});
|
|
2125
|
+
} else {
|
|
2126
|
+
onFinished();
|
|
2127
|
+
}
|
|
2128
|
+
});
|
|
2129
|
+
const fullPath = buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls);
|
|
2130
|
+
const parsed = new URL(fullPath, platform.hasBrowserEnv ? platform.origin : void 0);
|
|
2131
|
+
const protocol = parsed.protocol || supportedProtocols[0];
|
|
2132
|
+
if (protocol === "data:") {
|
|
2133
|
+
if (config.maxContentLength > -1) {
|
|
2134
|
+
const dataUrl = String(config.url || fullPath || "");
|
|
2135
|
+
const estimated = estimateDataURLDecodedBytes(dataUrl);
|
|
2136
|
+
if (estimated > config.maxContentLength) {
|
|
2137
|
+
return reject(
|
|
2138
|
+
new AxiosError$1(
|
|
2139
|
+
"maxContentLength size of " + config.maxContentLength + " exceeded",
|
|
2140
|
+
AxiosError$1.ERR_BAD_RESPONSE,
|
|
2141
|
+
config
|
|
2142
|
+
)
|
|
2143
|
+
);
|
|
2144
|
+
}
|
|
2145
|
+
}
|
|
2146
|
+
let convertedData;
|
|
2147
|
+
if (method !== "GET") {
|
|
2148
|
+
return settle(resolve, reject, {
|
|
2149
|
+
status: 405,
|
|
2150
|
+
statusText: "method not allowed",
|
|
2151
|
+
headers: {},
|
|
2152
|
+
config
|
|
2153
|
+
});
|
|
2154
|
+
}
|
|
2155
|
+
try {
|
|
2156
|
+
convertedData = fromDataURI(config.url, responseType === "blob", {
|
|
2157
|
+
Blob: config.env && config.env.Blob
|
|
2158
|
+
});
|
|
2159
|
+
} catch (err) {
|
|
2160
|
+
throw AxiosError$1.from(err, AxiosError$1.ERR_BAD_REQUEST, config);
|
|
2161
|
+
}
|
|
2162
|
+
if (responseType === "text") {
|
|
2163
|
+
convertedData = convertedData.toString(responseEncoding);
|
|
2164
|
+
if (!responseEncoding || responseEncoding === "utf8") {
|
|
2165
|
+
convertedData = utils$1.stripBOM(convertedData);
|
|
2166
|
+
}
|
|
2167
|
+
} else if (responseType === "stream") {
|
|
2168
|
+
convertedData = stream__default["default"].Readable.from(convertedData);
|
|
2169
|
+
}
|
|
2170
|
+
return settle(resolve, reject, {
|
|
2171
|
+
data: convertedData,
|
|
2172
|
+
status: 200,
|
|
2173
|
+
statusText: "OK",
|
|
2174
|
+
headers: new AxiosHeaders$1(),
|
|
2175
|
+
config
|
|
2176
|
+
});
|
|
2177
|
+
}
|
|
2178
|
+
if (supportedProtocols.indexOf(protocol) === -1) {
|
|
2179
|
+
return reject(
|
|
2180
|
+
new AxiosError$1("Unsupported protocol " + protocol, AxiosError$1.ERR_BAD_REQUEST, config)
|
|
2181
|
+
);
|
|
2182
|
+
}
|
|
2183
|
+
const headers = AxiosHeaders$1.from(config.headers).normalize();
|
|
2184
|
+
headers.set("User-Agent", "axios/" + VERSION, false);
|
|
2185
|
+
const { onUploadProgress, onDownloadProgress } = config;
|
|
2186
|
+
const maxRate = config.maxRate;
|
|
2187
|
+
let maxUploadRate = void 0;
|
|
2188
|
+
let maxDownloadRate = void 0;
|
|
2189
|
+
if (utils$1.isSpecCompliantForm(data)) {
|
|
2190
|
+
const userBoundary = headers.getContentType(/boundary=([-_\w\d]{10,70})/i);
|
|
2191
|
+
data = formDataToStream$1(
|
|
2192
|
+
data,
|
|
2193
|
+
(formHeaders) => {
|
|
2194
|
+
headers.set(formHeaders);
|
|
2195
|
+
},
|
|
2196
|
+
{
|
|
2197
|
+
tag: `axios-${VERSION}-boundary`,
|
|
2198
|
+
boundary: userBoundary && userBoundary[1] || void 0
|
|
2199
|
+
}
|
|
2200
|
+
);
|
|
2201
|
+
} else if (utils$1.isFormData(data) && utils$1.isFunction(data.getHeaders)) {
|
|
2202
|
+
headers.set(data.getHeaders());
|
|
2203
|
+
if (!headers.hasContentLength()) {
|
|
2204
|
+
try {
|
|
2205
|
+
const knownLength = await util__default["default"].promisify(data.getLength).call(data);
|
|
2206
|
+
Number.isFinite(knownLength) && knownLength >= 0 && headers.setContentLength(knownLength);
|
|
2207
|
+
} catch (e) {
|
|
2208
|
+
}
|
|
2209
|
+
}
|
|
2210
|
+
} else if (utils$1.isBlob(data) || utils$1.isFile(data)) {
|
|
2211
|
+
data.size && headers.setContentType(data.type || "application/octet-stream");
|
|
2212
|
+
headers.setContentLength(data.size || 0);
|
|
2213
|
+
data = stream__default["default"].Readable.from(readBlob$1(data));
|
|
2214
|
+
} else if (data && !utils$1.isStream(data)) {
|
|
2215
|
+
if (Buffer.isBuffer(data)) ;
|
|
2216
|
+
else if (utils$1.isArrayBuffer(data)) {
|
|
2217
|
+
data = Buffer.from(new Uint8Array(data));
|
|
2218
|
+
} else if (utils$1.isString(data)) {
|
|
2219
|
+
data = Buffer.from(data, "utf-8");
|
|
2220
|
+
} else {
|
|
2221
|
+
return reject(
|
|
2222
|
+
new AxiosError$1(
|
|
2223
|
+
"Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream",
|
|
2224
|
+
AxiosError$1.ERR_BAD_REQUEST,
|
|
2225
|
+
config
|
|
2226
|
+
)
|
|
2227
|
+
);
|
|
2228
|
+
}
|
|
2229
|
+
headers.setContentLength(data.length, false);
|
|
2230
|
+
if (config.maxBodyLength > -1 && data.length > config.maxBodyLength) {
|
|
2231
|
+
return reject(
|
|
2232
|
+
new AxiosError$1(
|
|
2233
|
+
"Request body larger than maxBodyLength limit",
|
|
2234
|
+
AxiosError$1.ERR_BAD_REQUEST,
|
|
2235
|
+
config
|
|
2236
|
+
)
|
|
2237
|
+
);
|
|
2238
|
+
}
|
|
2239
|
+
}
|
|
2240
|
+
const contentLength = utils$1.toFiniteNumber(headers.getContentLength());
|
|
2241
|
+
if (utils$1.isArray(maxRate)) {
|
|
2242
|
+
maxUploadRate = maxRate[0];
|
|
2243
|
+
maxDownloadRate = maxRate[1];
|
|
2244
|
+
} else {
|
|
2245
|
+
maxUploadRate = maxDownloadRate = maxRate;
|
|
2246
|
+
}
|
|
2247
|
+
if (data && (onUploadProgress || maxUploadRate)) {
|
|
2248
|
+
if (!utils$1.isStream(data)) {
|
|
2249
|
+
data = stream__default["default"].Readable.from(data, { objectMode: false });
|
|
2250
|
+
}
|
|
2251
|
+
data = stream__default["default"].pipeline(
|
|
2252
|
+
[
|
|
2253
|
+
data,
|
|
2254
|
+
new AxiosTransformStream$1({
|
|
2255
|
+
maxRate: utils$1.toFiniteNumber(maxUploadRate)
|
|
2256
|
+
})
|
|
2257
|
+
],
|
|
2258
|
+
utils$1.noop
|
|
2259
|
+
);
|
|
2260
|
+
onUploadProgress && data.on(
|
|
2261
|
+
"progress",
|
|
2262
|
+
flushOnFinish(
|
|
2263
|
+
data,
|
|
2264
|
+
progressEventDecorator(
|
|
2265
|
+
contentLength,
|
|
2266
|
+
progressEventReducer(asyncDecorator(onUploadProgress), false, 3)
|
|
2267
|
+
)
|
|
2268
|
+
)
|
|
2269
|
+
);
|
|
2270
|
+
}
|
|
2271
|
+
let auth = void 0;
|
|
2272
|
+
if (config.auth) {
|
|
2273
|
+
const username = config.auth.username || "";
|
|
2274
|
+
const password = config.auth.password || "";
|
|
2275
|
+
auth = username + ":" + password;
|
|
2276
|
+
}
|
|
2277
|
+
if (!auth && parsed.username) {
|
|
2278
|
+
const urlUsername = parsed.username;
|
|
2279
|
+
const urlPassword = parsed.password;
|
|
2280
|
+
auth = urlUsername + ":" + urlPassword;
|
|
2281
|
+
}
|
|
2282
|
+
auth && headers.delete("authorization");
|
|
2283
|
+
let path;
|
|
2284
|
+
try {
|
|
2285
|
+
path = buildURL(
|
|
2286
|
+
parsed.pathname + parsed.search,
|
|
2287
|
+
config.params,
|
|
2288
|
+
config.paramsSerializer
|
|
2289
|
+
).replace(/^\?/, "");
|
|
2290
|
+
} catch (err) {
|
|
2291
|
+
const customErr = new Error(err.message);
|
|
2292
|
+
customErr.config = config;
|
|
2293
|
+
customErr.url = config.url;
|
|
2294
|
+
customErr.exists = true;
|
|
2295
|
+
return reject(customErr);
|
|
2296
|
+
}
|
|
2297
|
+
headers.set(
|
|
2298
|
+
"Accept-Encoding",
|
|
2299
|
+
"gzip, compress, deflate" + (isBrotliSupported ? ", br" : ""),
|
|
2300
|
+
false
|
|
2301
|
+
);
|
|
2302
|
+
const options = {
|
|
2303
|
+
path,
|
|
2304
|
+
method,
|
|
2305
|
+
headers: headers.toJSON(),
|
|
2306
|
+
agents: { http: config.httpAgent, https: config.httpsAgent },
|
|
2307
|
+
auth,
|
|
2308
|
+
protocol,
|
|
2309
|
+
family,
|
|
2310
|
+
beforeRedirect: dispatchBeforeRedirect,
|
|
2311
|
+
beforeRedirects: {},
|
|
2312
|
+
http2Options
|
|
2313
|
+
};
|
|
2314
|
+
!utils$1.isUndefined(lookup) && (options.lookup = lookup);
|
|
2315
|
+
if (config.socketPath) {
|
|
2316
|
+
options.socketPath = config.socketPath;
|
|
2317
|
+
} else {
|
|
2318
|
+
options.hostname = parsed.hostname.startsWith("[") ? parsed.hostname.slice(1, -1) : parsed.hostname;
|
|
2319
|
+
options.port = parsed.port;
|
|
2320
|
+
setProxy(
|
|
2321
|
+
options,
|
|
2322
|
+
config.proxy,
|
|
2323
|
+
protocol + "//" + parsed.hostname + (parsed.port ? ":" + parsed.port : "") + options.path
|
|
2324
|
+
);
|
|
2325
|
+
}
|
|
2326
|
+
let transport;
|
|
2327
|
+
const isHttpsRequest = isHttps.test(options.protocol);
|
|
2328
|
+
options.agent = isHttpsRequest ? config.httpsAgent : config.httpAgent;
|
|
2329
|
+
if (isHttp2) {
|
|
2330
|
+
transport = http2Transport;
|
|
2331
|
+
} else {
|
|
2332
|
+
if (config.transport) {
|
|
2333
|
+
transport = config.transport;
|
|
2334
|
+
} else if (config.maxRedirects === 0) {
|
|
2335
|
+
transport = isHttpsRequest ? https__default["default"] : http__default["default"];
|
|
2336
|
+
} else {
|
|
2337
|
+
if (config.maxRedirects) {
|
|
2338
|
+
options.maxRedirects = config.maxRedirects;
|
|
2339
|
+
}
|
|
2340
|
+
if (config.beforeRedirect) {
|
|
2341
|
+
options.beforeRedirects.config = config.beforeRedirect;
|
|
2342
|
+
}
|
|
2343
|
+
transport = isHttpsRequest ? httpsFollow : httpFollow;
|
|
2344
|
+
}
|
|
2345
|
+
}
|
|
2346
|
+
if (config.maxBodyLength > -1) {
|
|
2347
|
+
options.maxBodyLength = config.maxBodyLength;
|
|
2348
|
+
} else {
|
|
2349
|
+
options.maxBodyLength = Infinity;
|
|
2350
|
+
}
|
|
2351
|
+
if (config.insecureHTTPParser) {
|
|
2352
|
+
options.insecureHTTPParser = config.insecureHTTPParser;
|
|
2353
|
+
}
|
|
2354
|
+
req = transport.request(options, /* @__PURE__ */ __name(function handleResponse(res) {
|
|
2355
|
+
if (req.destroyed) return;
|
|
2356
|
+
const streams = [res];
|
|
2357
|
+
const responseLength = utils$1.toFiniteNumber(res.headers["content-length"]);
|
|
2358
|
+
if (onDownloadProgress || maxDownloadRate) {
|
|
2359
|
+
const transformStream = new AxiosTransformStream$1({
|
|
2360
|
+
maxRate: utils$1.toFiniteNumber(maxDownloadRate)
|
|
2361
|
+
});
|
|
2362
|
+
onDownloadProgress && transformStream.on(
|
|
2363
|
+
"progress",
|
|
2364
|
+
flushOnFinish(
|
|
2365
|
+
transformStream,
|
|
2366
|
+
progressEventDecorator(
|
|
2367
|
+
responseLength,
|
|
2368
|
+
progressEventReducer(asyncDecorator(onDownloadProgress), true, 3)
|
|
2369
|
+
)
|
|
2370
|
+
)
|
|
2371
|
+
);
|
|
2372
|
+
streams.push(transformStream);
|
|
2373
|
+
}
|
|
2374
|
+
let responseStream = res;
|
|
2375
|
+
const lastRequest = res.req || req;
|
|
2376
|
+
if (config.decompress !== false && res.headers["content-encoding"]) {
|
|
2377
|
+
if (method === "HEAD" || res.statusCode === 204) {
|
|
2378
|
+
delete res.headers["content-encoding"];
|
|
2379
|
+
}
|
|
2380
|
+
switch ((res.headers["content-encoding"] || "").toLowerCase()) {
|
|
2381
|
+
/*eslint default-case:0*/
|
|
2382
|
+
case "gzip":
|
|
2383
|
+
case "x-gzip":
|
|
2384
|
+
case "compress":
|
|
2385
|
+
case "x-compress":
|
|
2386
|
+
streams.push(zlib__default["default"].createUnzip(zlibOptions));
|
|
2387
|
+
delete res.headers["content-encoding"];
|
|
2388
|
+
break;
|
|
2389
|
+
case "deflate":
|
|
2390
|
+
streams.push(new ZlibHeaderTransformStream$1());
|
|
2391
|
+
streams.push(zlib__default["default"].createUnzip(zlibOptions));
|
|
2392
|
+
delete res.headers["content-encoding"];
|
|
2393
|
+
break;
|
|
2394
|
+
case "br":
|
|
2395
|
+
if (isBrotliSupported) {
|
|
2396
|
+
streams.push(zlib__default["default"].createBrotliDecompress(brotliOptions));
|
|
2397
|
+
delete res.headers["content-encoding"];
|
|
2398
|
+
}
|
|
2399
|
+
}
|
|
2400
|
+
}
|
|
2401
|
+
responseStream = streams.length > 1 ? stream__default["default"].pipeline(streams, utils$1.noop) : streams[0];
|
|
2402
|
+
const response = {
|
|
2403
|
+
status: res.statusCode,
|
|
2404
|
+
statusText: res.statusMessage,
|
|
2405
|
+
headers: new AxiosHeaders$1(res.headers),
|
|
2406
|
+
config,
|
|
2407
|
+
request: lastRequest
|
|
2408
|
+
};
|
|
2409
|
+
if (responseType === "stream") {
|
|
2410
|
+
response.data = responseStream;
|
|
2411
|
+
settle(resolve, reject, response);
|
|
2412
|
+
} else {
|
|
2413
|
+
const responseBuffer = [];
|
|
2414
|
+
let totalResponseBytes = 0;
|
|
2415
|
+
responseStream.on("data", /* @__PURE__ */ __name(function handleStreamData(chunk) {
|
|
2416
|
+
responseBuffer.push(chunk);
|
|
2417
|
+
totalResponseBytes += chunk.length;
|
|
2418
|
+
if (config.maxContentLength > -1 && totalResponseBytes > config.maxContentLength) {
|
|
2419
|
+
rejected = true;
|
|
2420
|
+
responseStream.destroy();
|
|
2421
|
+
abort(
|
|
2422
|
+
new AxiosError$1(
|
|
2423
|
+
"maxContentLength size of " + config.maxContentLength + " exceeded",
|
|
2424
|
+
AxiosError$1.ERR_BAD_RESPONSE,
|
|
2425
|
+
config,
|
|
2426
|
+
lastRequest
|
|
2427
|
+
)
|
|
2428
|
+
);
|
|
2429
|
+
}
|
|
2430
|
+
}, "handleStreamData"));
|
|
2431
|
+
responseStream.on("aborted", /* @__PURE__ */ __name(function handlerStreamAborted() {
|
|
2432
|
+
if (rejected) {
|
|
2433
|
+
return;
|
|
2434
|
+
}
|
|
2435
|
+
const err = new AxiosError$1(
|
|
2436
|
+
"stream has been aborted",
|
|
2437
|
+
AxiosError$1.ERR_BAD_RESPONSE,
|
|
2438
|
+
config,
|
|
2439
|
+
lastRequest
|
|
2440
|
+
);
|
|
2441
|
+
responseStream.destroy(err);
|
|
2442
|
+
reject(err);
|
|
2443
|
+
}, "handlerStreamAborted"));
|
|
2444
|
+
responseStream.on("error", /* @__PURE__ */ __name(function handleStreamError(err) {
|
|
2445
|
+
if (req.destroyed) return;
|
|
2446
|
+
reject(AxiosError$1.from(err, null, config, lastRequest));
|
|
2447
|
+
}, "handleStreamError"));
|
|
2448
|
+
responseStream.on("end", /* @__PURE__ */ __name(function handleStreamEnd() {
|
|
2449
|
+
try {
|
|
2450
|
+
let responseData = responseBuffer.length === 1 ? responseBuffer[0] : Buffer.concat(responseBuffer);
|
|
2451
|
+
if (responseType !== "arraybuffer") {
|
|
2452
|
+
responseData = responseData.toString(responseEncoding);
|
|
2453
|
+
if (!responseEncoding || responseEncoding === "utf8") {
|
|
2454
|
+
responseData = utils$1.stripBOM(responseData);
|
|
2455
|
+
}
|
|
2456
|
+
}
|
|
2457
|
+
response.data = responseData;
|
|
2458
|
+
} catch (err) {
|
|
2459
|
+
return reject(AxiosError$1.from(err, null, config, response.request, response));
|
|
2460
|
+
}
|
|
2461
|
+
settle(resolve, reject, response);
|
|
2462
|
+
}, "handleStreamEnd"));
|
|
2463
|
+
}
|
|
2464
|
+
abortEmitter.once("abort", (err) => {
|
|
2465
|
+
if (!responseStream.destroyed) {
|
|
2466
|
+
responseStream.emit("error", err);
|
|
2467
|
+
responseStream.destroy();
|
|
2468
|
+
}
|
|
2469
|
+
});
|
|
2470
|
+
}, "handleResponse"));
|
|
2471
|
+
abortEmitter.once("abort", (err) => {
|
|
2472
|
+
if (req.close) {
|
|
2473
|
+
req.close();
|
|
2474
|
+
} else {
|
|
2475
|
+
req.destroy(err);
|
|
2476
|
+
}
|
|
2477
|
+
});
|
|
2478
|
+
req.on("error", /* @__PURE__ */ __name(function handleRequestError(err) {
|
|
2479
|
+
reject(AxiosError$1.from(err, null, config, req));
|
|
2480
|
+
}, "handleRequestError"));
|
|
2481
|
+
req.on("socket", /* @__PURE__ */ __name(function handleRequestSocket(socket) {
|
|
2482
|
+
socket.setKeepAlive(true, 1e3 * 60);
|
|
2483
|
+
}, "handleRequestSocket"));
|
|
2484
|
+
if (config.timeout) {
|
|
2485
|
+
const timeout = parseInt(config.timeout, 10);
|
|
2486
|
+
if (Number.isNaN(timeout)) {
|
|
2487
|
+
abort(
|
|
2488
|
+
new AxiosError$1(
|
|
2489
|
+
"error trying to parse `config.timeout` to int",
|
|
2490
|
+
AxiosError$1.ERR_BAD_OPTION_VALUE,
|
|
2491
|
+
config,
|
|
2492
|
+
req
|
|
2493
|
+
)
|
|
2494
|
+
);
|
|
2495
|
+
return;
|
|
2496
|
+
}
|
|
2497
|
+
req.setTimeout(timeout, /* @__PURE__ */ __name(function handleRequestTimeout() {
|
|
2498
|
+
if (isDone) return;
|
|
2499
|
+
let timeoutErrorMessage = config.timeout ? "timeout of " + config.timeout + "ms exceeded" : "timeout exceeded";
|
|
2500
|
+
const transitional = config.transitional || transitionalDefaults;
|
|
2501
|
+
if (config.timeoutErrorMessage) {
|
|
2502
|
+
timeoutErrorMessage = config.timeoutErrorMessage;
|
|
2503
|
+
}
|
|
2504
|
+
abort(
|
|
2505
|
+
new AxiosError$1(
|
|
2506
|
+
timeoutErrorMessage,
|
|
2507
|
+
transitional.clarifyTimeoutError ? AxiosError$1.ETIMEDOUT : AxiosError$1.ECONNABORTED,
|
|
2508
|
+
config,
|
|
2509
|
+
req
|
|
2510
|
+
)
|
|
2511
|
+
);
|
|
2512
|
+
}, "handleRequestTimeout"));
|
|
2513
|
+
} else {
|
|
2514
|
+
req.setTimeout(0);
|
|
2515
|
+
}
|
|
2516
|
+
if (utils$1.isStream(data)) {
|
|
2517
|
+
let ended = false;
|
|
2518
|
+
let errored = false;
|
|
2519
|
+
data.on("end", () => {
|
|
2520
|
+
ended = true;
|
|
2521
|
+
});
|
|
2522
|
+
data.once("error", (err) => {
|
|
2523
|
+
errored = true;
|
|
2524
|
+
req.destroy(err);
|
|
2525
|
+
});
|
|
2526
|
+
data.on("close", () => {
|
|
2527
|
+
if (!ended && !errored) {
|
|
2528
|
+
abort(new CanceledError$1("Request stream has been aborted", config, req));
|
|
2529
|
+
}
|
|
2530
|
+
});
|
|
2531
|
+
data.pipe(req);
|
|
2532
|
+
} else {
|
|
2533
|
+
data && req.write(data);
|
|
2534
|
+
req.end();
|
|
2535
|
+
}
|
|
2536
|
+
}, "dispatchHttpRequest"));
|
|
2537
|
+
}, "httpAdapter");
|
|
2538
|
+
var isURLSameOrigin = platform.hasStandardBrowserEnv ? /* @__PURE__ */ ((origin2, isMSIE) => (url2) => {
|
|
2539
|
+
url2 = new URL(url2, platform.origin);
|
|
2540
|
+
return origin2.protocol === url2.protocol && origin2.host === url2.host && (isMSIE || origin2.port === url2.port);
|
|
2541
|
+
})(
|
|
2542
|
+
new URL(platform.origin),
|
|
2543
|
+
platform.navigator && /(msie|trident)/i.test(platform.navigator.userAgent)
|
|
2544
|
+
) : () => true;
|
|
2545
|
+
var cookies = platform.hasStandardBrowserEnv ? (
|
|
2546
|
+
// Standard browser envs support document.cookie
|
|
2547
|
+
{
|
|
2548
|
+
write(name, value, expires, path, domain, secure, sameSite) {
|
|
2549
|
+
if (typeof document === "undefined") return;
|
|
2550
|
+
const cookie = [`${name}=${encodeURIComponent(value)}`];
|
|
2551
|
+
if (utils$1.isNumber(expires)) {
|
|
2552
|
+
cookie.push(`expires=${new Date(expires).toUTCString()}`);
|
|
2553
|
+
}
|
|
2554
|
+
if (utils$1.isString(path)) {
|
|
2555
|
+
cookie.push(`path=${path}`);
|
|
2556
|
+
}
|
|
2557
|
+
if (utils$1.isString(domain)) {
|
|
2558
|
+
cookie.push(`domain=${domain}`);
|
|
2559
|
+
}
|
|
2560
|
+
if (secure === true) {
|
|
2561
|
+
cookie.push("secure");
|
|
2562
|
+
}
|
|
2563
|
+
if (utils$1.isString(sameSite)) {
|
|
2564
|
+
cookie.push(`SameSite=${sameSite}`);
|
|
2565
|
+
}
|
|
2566
|
+
document.cookie = cookie.join("; ");
|
|
2567
|
+
},
|
|
2568
|
+
read(name) {
|
|
2569
|
+
if (typeof document === "undefined") return null;
|
|
2570
|
+
const match = document.cookie.match(new RegExp("(?:^|; )" + name + "=([^;]*)"));
|
|
2571
|
+
return match ? decodeURIComponent(match[1]) : null;
|
|
2572
|
+
},
|
|
2573
|
+
remove(name) {
|
|
2574
|
+
this.write(name, "", Date.now() - 864e5, "/");
|
|
2575
|
+
}
|
|
2576
|
+
}
|
|
2577
|
+
) : (
|
|
2578
|
+
// Non-standard browser env (web workers, react-native) lack needed support.
|
|
2579
|
+
{
|
|
2580
|
+
write() {
|
|
2581
|
+
},
|
|
2582
|
+
read() {
|
|
2583
|
+
return null;
|
|
2584
|
+
},
|
|
2585
|
+
remove() {
|
|
2586
|
+
}
|
|
2587
|
+
}
|
|
2588
|
+
);
|
|
2589
|
+
var headersToObject = /* @__PURE__ */ __name((thing) => thing instanceof AxiosHeaders$1 ? { ...thing } : thing, "headersToObject");
|
|
2590
|
+
function mergeConfig(config1, config2) {
|
|
2591
|
+
config2 = config2 || {};
|
|
2592
|
+
const config = {};
|
|
2593
|
+
function getMergedValue(target, source, prop, caseless) {
|
|
2594
|
+
if (utils$1.isPlainObject(target) && utils$1.isPlainObject(source)) {
|
|
2595
|
+
return utils$1.merge.call({ caseless }, target, source);
|
|
2596
|
+
} else if (utils$1.isPlainObject(source)) {
|
|
2597
|
+
return utils$1.merge({}, source);
|
|
2598
|
+
} else if (utils$1.isArray(source)) {
|
|
2599
|
+
return source.slice();
|
|
2600
|
+
}
|
|
2601
|
+
return source;
|
|
2602
|
+
}
|
|
2603
|
+
__name(getMergedValue, "getMergedValue");
|
|
2604
|
+
function mergeDeepProperties(a, b, prop, caseless) {
|
|
2605
|
+
if (!utils$1.isUndefined(b)) {
|
|
2606
|
+
return getMergedValue(a, b, prop, caseless);
|
|
2607
|
+
} else if (!utils$1.isUndefined(a)) {
|
|
2608
|
+
return getMergedValue(void 0, a, prop, caseless);
|
|
2609
|
+
}
|
|
2610
|
+
}
|
|
2611
|
+
__name(mergeDeepProperties, "mergeDeepProperties");
|
|
2612
|
+
function valueFromConfig2(a, b) {
|
|
2613
|
+
if (!utils$1.isUndefined(b)) {
|
|
2614
|
+
return getMergedValue(void 0, b);
|
|
2615
|
+
}
|
|
2616
|
+
}
|
|
2617
|
+
__name(valueFromConfig2, "valueFromConfig2");
|
|
2618
|
+
function defaultToConfig2(a, b) {
|
|
2619
|
+
if (!utils$1.isUndefined(b)) {
|
|
2620
|
+
return getMergedValue(void 0, b);
|
|
2621
|
+
} else if (!utils$1.isUndefined(a)) {
|
|
2622
|
+
return getMergedValue(void 0, a);
|
|
2623
|
+
}
|
|
2624
|
+
}
|
|
2625
|
+
__name(defaultToConfig2, "defaultToConfig2");
|
|
2626
|
+
function mergeDirectKeys(a, b, prop) {
|
|
2627
|
+
if (prop in config2) {
|
|
2628
|
+
return getMergedValue(a, b);
|
|
2629
|
+
} else if (prop in config1) {
|
|
2630
|
+
return getMergedValue(void 0, a);
|
|
2631
|
+
}
|
|
2632
|
+
}
|
|
2633
|
+
__name(mergeDirectKeys, "mergeDirectKeys");
|
|
2634
|
+
const mergeMap = {
|
|
2635
|
+
url: valueFromConfig2,
|
|
2636
|
+
method: valueFromConfig2,
|
|
2637
|
+
data: valueFromConfig2,
|
|
2638
|
+
baseURL: defaultToConfig2,
|
|
2639
|
+
transformRequest: defaultToConfig2,
|
|
2640
|
+
transformResponse: defaultToConfig2,
|
|
2641
|
+
paramsSerializer: defaultToConfig2,
|
|
2642
|
+
timeout: defaultToConfig2,
|
|
2643
|
+
timeoutMessage: defaultToConfig2,
|
|
2644
|
+
withCredentials: defaultToConfig2,
|
|
2645
|
+
withXSRFToken: defaultToConfig2,
|
|
2646
|
+
adapter: defaultToConfig2,
|
|
2647
|
+
responseType: defaultToConfig2,
|
|
2648
|
+
xsrfCookieName: defaultToConfig2,
|
|
2649
|
+
xsrfHeaderName: defaultToConfig2,
|
|
2650
|
+
onUploadProgress: defaultToConfig2,
|
|
2651
|
+
onDownloadProgress: defaultToConfig2,
|
|
2652
|
+
decompress: defaultToConfig2,
|
|
2653
|
+
maxContentLength: defaultToConfig2,
|
|
2654
|
+
maxBodyLength: defaultToConfig2,
|
|
2655
|
+
beforeRedirect: defaultToConfig2,
|
|
2656
|
+
transport: defaultToConfig2,
|
|
2657
|
+
httpAgent: defaultToConfig2,
|
|
2658
|
+
httpsAgent: defaultToConfig2,
|
|
2659
|
+
cancelToken: defaultToConfig2,
|
|
2660
|
+
socketPath: defaultToConfig2,
|
|
2661
|
+
responseEncoding: defaultToConfig2,
|
|
2662
|
+
validateStatus: mergeDirectKeys,
|
|
2663
|
+
headers: /* @__PURE__ */ __name((a, b, prop) => mergeDeepProperties(headersToObject(a), headersToObject(b), prop, true), "headers")
|
|
2664
|
+
};
|
|
2665
|
+
utils$1.forEach(Object.keys({ ...config1, ...config2 }), /* @__PURE__ */ __name(function computeConfigValue(prop) {
|
|
2666
|
+
if (prop === "__proto__" || prop === "constructor" || prop === "prototype") return;
|
|
2667
|
+
const merge2 = utils$1.hasOwnProp(mergeMap, prop) ? mergeMap[prop] : mergeDeepProperties;
|
|
2668
|
+
const configValue = merge2(config1[prop], config2[prop], prop);
|
|
2669
|
+
utils$1.isUndefined(configValue) && merge2 !== mergeDirectKeys || (config[prop] = configValue);
|
|
2670
|
+
}, "computeConfigValue"));
|
|
2671
|
+
return config;
|
|
2672
|
+
}
|
|
2673
|
+
__name(mergeConfig, "mergeConfig");
|
|
2674
|
+
var resolveConfig = /* @__PURE__ */ __name((config) => {
|
|
2675
|
+
const newConfig = mergeConfig({}, config);
|
|
2676
|
+
let { data, withXSRFToken, xsrfHeaderName, xsrfCookieName, headers, auth } = newConfig;
|
|
2677
|
+
newConfig.headers = headers = AxiosHeaders$1.from(headers);
|
|
2678
|
+
newConfig.url = buildURL(
|
|
2679
|
+
buildFullPath(newConfig.baseURL, newConfig.url, newConfig.allowAbsoluteUrls),
|
|
2680
|
+
config.params,
|
|
2681
|
+
config.paramsSerializer
|
|
2682
|
+
);
|
|
2683
|
+
if (auth) {
|
|
2684
|
+
headers.set(
|
|
2685
|
+
"Authorization",
|
|
2686
|
+
"Basic " + btoa(
|
|
2687
|
+
(auth.username || "") + ":" + (auth.password ? unescape(encodeURIComponent(auth.password)) : "")
|
|
2688
|
+
)
|
|
2689
|
+
);
|
|
2690
|
+
}
|
|
2691
|
+
if (utils$1.isFormData(data)) {
|
|
2692
|
+
if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv) {
|
|
2693
|
+
headers.setContentType(void 0);
|
|
2694
|
+
} else if (utils$1.isFunction(data.getHeaders)) {
|
|
2695
|
+
const formHeaders = data.getHeaders();
|
|
2696
|
+
const allowedHeaders = ["content-type", "content-length"];
|
|
2697
|
+
Object.entries(formHeaders).forEach(([key, val]) => {
|
|
2698
|
+
if (allowedHeaders.includes(key.toLowerCase())) {
|
|
2699
|
+
headers.set(key, val);
|
|
2700
|
+
}
|
|
2701
|
+
});
|
|
2702
|
+
}
|
|
2703
|
+
}
|
|
2704
|
+
if (platform.hasStandardBrowserEnv) {
|
|
2705
|
+
withXSRFToken && utils$1.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(newConfig));
|
|
2706
|
+
if (withXSRFToken || withXSRFToken !== false && isURLSameOrigin(newConfig.url)) {
|
|
2707
|
+
const xsrfValue = xsrfHeaderName && xsrfCookieName && cookies.read(xsrfCookieName);
|
|
2708
|
+
if (xsrfValue) {
|
|
2709
|
+
headers.set(xsrfHeaderName, xsrfValue);
|
|
2710
|
+
}
|
|
2711
|
+
}
|
|
2712
|
+
}
|
|
2713
|
+
return newConfig;
|
|
2714
|
+
}, "resolveConfig");
|
|
2715
|
+
var isXHRAdapterSupported = typeof XMLHttpRequest !== "undefined";
|
|
2716
|
+
var xhrAdapter = isXHRAdapterSupported && function(config) {
|
|
2717
|
+
return new Promise(/* @__PURE__ */ __name(function dispatchXhrRequest(resolve, reject) {
|
|
2718
|
+
const _config = resolveConfig(config);
|
|
2719
|
+
let requestData = _config.data;
|
|
2720
|
+
const requestHeaders = AxiosHeaders$1.from(_config.headers).normalize();
|
|
2721
|
+
let { responseType, onUploadProgress, onDownloadProgress } = _config;
|
|
2722
|
+
let onCanceled;
|
|
2723
|
+
let uploadThrottled, downloadThrottled;
|
|
2724
|
+
let flushUpload, flushDownload;
|
|
2725
|
+
function done() {
|
|
2726
|
+
flushUpload && flushUpload();
|
|
2727
|
+
flushDownload && flushDownload();
|
|
2728
|
+
_config.cancelToken && _config.cancelToken.unsubscribe(onCanceled);
|
|
2729
|
+
_config.signal && _config.signal.removeEventListener("abort", onCanceled);
|
|
2730
|
+
}
|
|
2731
|
+
__name(done, "done");
|
|
2732
|
+
let request = new XMLHttpRequest();
|
|
2733
|
+
request.open(_config.method.toUpperCase(), _config.url, true);
|
|
2734
|
+
request.timeout = _config.timeout;
|
|
2735
|
+
function onloadend() {
|
|
2736
|
+
if (!request) {
|
|
2737
|
+
return;
|
|
2738
|
+
}
|
|
2739
|
+
const responseHeaders = AxiosHeaders$1.from(
|
|
2740
|
+
"getAllResponseHeaders" in request && request.getAllResponseHeaders()
|
|
2741
|
+
);
|
|
2742
|
+
const responseData = !responseType || responseType === "text" || responseType === "json" ? request.responseText : request.response;
|
|
2743
|
+
const response = {
|
|
2744
|
+
data: responseData,
|
|
2745
|
+
status: request.status,
|
|
2746
|
+
statusText: request.statusText,
|
|
2747
|
+
headers: responseHeaders,
|
|
2748
|
+
config,
|
|
2749
|
+
request
|
|
2750
|
+
};
|
|
2751
|
+
settle(
|
|
2752
|
+
/* @__PURE__ */ __name(function _resolve(value) {
|
|
2753
|
+
resolve(value);
|
|
2754
|
+
done();
|
|
2755
|
+
}, "_resolve"),
|
|
2756
|
+
/* @__PURE__ */ __name(function _reject(err) {
|
|
2757
|
+
reject(err);
|
|
2758
|
+
done();
|
|
2759
|
+
}, "_reject"),
|
|
2760
|
+
response
|
|
2761
|
+
);
|
|
2762
|
+
request = null;
|
|
2763
|
+
}
|
|
2764
|
+
__name(onloadend, "onloadend");
|
|
2765
|
+
if ("onloadend" in request) {
|
|
2766
|
+
request.onloadend = onloadend;
|
|
2767
|
+
} else {
|
|
2768
|
+
request.onreadystatechange = /* @__PURE__ */ __name(function handleLoad() {
|
|
2769
|
+
if (!request || request.readyState !== 4) {
|
|
2770
|
+
return;
|
|
2771
|
+
}
|
|
2772
|
+
if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf("file:") === 0)) {
|
|
2773
|
+
return;
|
|
2774
|
+
}
|
|
2775
|
+
setTimeout(onloadend);
|
|
2776
|
+
}, "handleLoad");
|
|
2777
|
+
}
|
|
2778
|
+
request.onabort = /* @__PURE__ */ __name(function handleAbort() {
|
|
2779
|
+
if (!request) {
|
|
2780
|
+
return;
|
|
2781
|
+
}
|
|
2782
|
+
reject(new AxiosError$1("Request aborted", AxiosError$1.ECONNABORTED, config, request));
|
|
2783
|
+
request = null;
|
|
2784
|
+
}, "handleAbort");
|
|
2785
|
+
request.onerror = /* @__PURE__ */ __name(function handleError(event) {
|
|
2786
|
+
const msg = event && event.message ? event.message : "Network Error";
|
|
2787
|
+
const err = new AxiosError$1(msg, AxiosError$1.ERR_NETWORK, config, request);
|
|
2788
|
+
err.event = event || null;
|
|
2789
|
+
reject(err);
|
|
2790
|
+
request = null;
|
|
2791
|
+
}, "handleError");
|
|
2792
|
+
request.ontimeout = /* @__PURE__ */ __name(function handleTimeout() {
|
|
2793
|
+
let timeoutErrorMessage = _config.timeout ? "timeout of " + _config.timeout + "ms exceeded" : "timeout exceeded";
|
|
2794
|
+
const transitional = _config.transitional || transitionalDefaults;
|
|
2795
|
+
if (_config.timeoutErrorMessage) {
|
|
2796
|
+
timeoutErrorMessage = _config.timeoutErrorMessage;
|
|
2797
|
+
}
|
|
2798
|
+
reject(
|
|
2799
|
+
new AxiosError$1(
|
|
2800
|
+
timeoutErrorMessage,
|
|
2801
|
+
transitional.clarifyTimeoutError ? AxiosError$1.ETIMEDOUT : AxiosError$1.ECONNABORTED,
|
|
2802
|
+
config,
|
|
2803
|
+
request
|
|
2804
|
+
)
|
|
2805
|
+
);
|
|
2806
|
+
request = null;
|
|
2807
|
+
}, "handleTimeout");
|
|
2808
|
+
requestData === void 0 && requestHeaders.setContentType(null);
|
|
2809
|
+
if ("setRequestHeader" in request) {
|
|
2810
|
+
utils$1.forEach(requestHeaders.toJSON(), /* @__PURE__ */ __name(function setRequestHeader(val, key) {
|
|
2811
|
+
request.setRequestHeader(key, val);
|
|
2812
|
+
}, "setRequestHeader"));
|
|
2813
|
+
}
|
|
2814
|
+
if (!utils$1.isUndefined(_config.withCredentials)) {
|
|
2815
|
+
request.withCredentials = !!_config.withCredentials;
|
|
2816
|
+
}
|
|
2817
|
+
if (responseType && responseType !== "json") {
|
|
2818
|
+
request.responseType = _config.responseType;
|
|
2819
|
+
}
|
|
2820
|
+
if (onDownloadProgress) {
|
|
2821
|
+
[downloadThrottled, flushDownload] = progressEventReducer(onDownloadProgress, true);
|
|
2822
|
+
request.addEventListener("progress", downloadThrottled);
|
|
2823
|
+
}
|
|
2824
|
+
if (onUploadProgress && request.upload) {
|
|
2825
|
+
[uploadThrottled, flushUpload] = progressEventReducer(onUploadProgress);
|
|
2826
|
+
request.upload.addEventListener("progress", uploadThrottled);
|
|
2827
|
+
request.upload.addEventListener("loadend", flushUpload);
|
|
2828
|
+
}
|
|
2829
|
+
if (_config.cancelToken || _config.signal) {
|
|
2830
|
+
onCanceled = /* @__PURE__ */ __name((cancel) => {
|
|
2831
|
+
if (!request) {
|
|
2832
|
+
return;
|
|
2833
|
+
}
|
|
2834
|
+
reject(!cancel || cancel.type ? new CanceledError$1(null, config, request) : cancel);
|
|
2835
|
+
request.abort();
|
|
2836
|
+
request = null;
|
|
2837
|
+
}, "onCanceled");
|
|
2838
|
+
_config.cancelToken && _config.cancelToken.subscribe(onCanceled);
|
|
2839
|
+
if (_config.signal) {
|
|
2840
|
+
_config.signal.aborted ? onCanceled() : _config.signal.addEventListener("abort", onCanceled);
|
|
2841
|
+
}
|
|
2842
|
+
}
|
|
2843
|
+
const protocol = parseProtocol(_config.url);
|
|
2844
|
+
if (protocol && platform.protocols.indexOf(protocol) === -1) {
|
|
2845
|
+
reject(
|
|
2846
|
+
new AxiosError$1(
|
|
2847
|
+
"Unsupported protocol " + protocol + ":",
|
|
2848
|
+
AxiosError$1.ERR_BAD_REQUEST,
|
|
2849
|
+
config
|
|
2850
|
+
)
|
|
2851
|
+
);
|
|
2852
|
+
return;
|
|
2853
|
+
}
|
|
2854
|
+
request.send(requestData || null);
|
|
2855
|
+
}, "dispatchXhrRequest"));
|
|
2856
|
+
};
|
|
2857
|
+
var composeSignals = /* @__PURE__ */ __name((signals, timeout) => {
|
|
2858
|
+
const { length } = signals = signals ? signals.filter(Boolean) : [];
|
|
2859
|
+
if (timeout || length) {
|
|
2860
|
+
let controller = new AbortController();
|
|
2861
|
+
let aborted;
|
|
2862
|
+
const onabort = /* @__PURE__ */ __name(function(reason) {
|
|
2863
|
+
if (!aborted) {
|
|
2864
|
+
aborted = true;
|
|
2865
|
+
unsubscribe();
|
|
2866
|
+
const err = reason instanceof Error ? reason : this.reason;
|
|
2867
|
+
controller.abort(
|
|
2868
|
+
err instanceof AxiosError$1 ? err : new CanceledError$1(err instanceof Error ? err.message : err)
|
|
2869
|
+
);
|
|
2870
|
+
}
|
|
2871
|
+
}, "onabort");
|
|
2872
|
+
let timer = timeout && setTimeout(() => {
|
|
2873
|
+
timer = null;
|
|
2874
|
+
onabort(new AxiosError$1(`timeout of ${timeout}ms exceeded`, AxiosError$1.ETIMEDOUT));
|
|
2875
|
+
}, timeout);
|
|
2876
|
+
const unsubscribe = /* @__PURE__ */ __name(() => {
|
|
2877
|
+
if (signals) {
|
|
2878
|
+
timer && clearTimeout(timer);
|
|
2879
|
+
timer = null;
|
|
2880
|
+
signals.forEach((signal2) => {
|
|
2881
|
+
signal2.unsubscribe ? signal2.unsubscribe(onabort) : signal2.removeEventListener("abort", onabort);
|
|
2882
|
+
});
|
|
2883
|
+
signals = null;
|
|
2884
|
+
}
|
|
2885
|
+
}, "unsubscribe");
|
|
2886
|
+
signals.forEach((signal2) => signal2.addEventListener("abort", onabort));
|
|
2887
|
+
const { signal } = controller;
|
|
2888
|
+
signal.unsubscribe = () => utils$1.asap(unsubscribe);
|
|
2889
|
+
return signal;
|
|
2890
|
+
}
|
|
2891
|
+
}, "composeSignals");
|
|
2892
|
+
var composeSignals$1 = composeSignals;
|
|
2893
|
+
var streamChunk = /* @__PURE__ */ __name(function* (chunk, chunkSize) {
|
|
2894
|
+
let len = chunk.byteLength;
|
|
2895
|
+
if (!chunkSize || len < chunkSize) {
|
|
2896
|
+
yield chunk;
|
|
2897
|
+
return;
|
|
2898
|
+
}
|
|
2899
|
+
let pos = 0;
|
|
2900
|
+
let end;
|
|
2901
|
+
while (pos < len) {
|
|
2902
|
+
end = pos + chunkSize;
|
|
2903
|
+
yield chunk.slice(pos, end);
|
|
2904
|
+
pos = end;
|
|
2905
|
+
}
|
|
2906
|
+
}, "streamChunk");
|
|
2907
|
+
var readBytes = /* @__PURE__ */ __name(async function* (iterable, chunkSize) {
|
|
2908
|
+
for await (const chunk of readStream(iterable)) {
|
|
2909
|
+
yield* streamChunk(chunk, chunkSize);
|
|
2910
|
+
}
|
|
2911
|
+
}, "readBytes");
|
|
2912
|
+
var readStream = /* @__PURE__ */ __name(async function* (stream2) {
|
|
2913
|
+
if (stream2[Symbol.asyncIterator]) {
|
|
2914
|
+
yield* stream2;
|
|
2915
|
+
return;
|
|
2916
|
+
}
|
|
2917
|
+
const reader = stream2.getReader();
|
|
2918
|
+
try {
|
|
2919
|
+
for (; ; ) {
|
|
2920
|
+
const { done, value } = await reader.read();
|
|
2921
|
+
if (done) {
|
|
2922
|
+
break;
|
|
2923
|
+
}
|
|
2924
|
+
yield value;
|
|
2925
|
+
}
|
|
2926
|
+
} finally {
|
|
2927
|
+
await reader.cancel();
|
|
2928
|
+
}
|
|
2929
|
+
}, "readStream");
|
|
2930
|
+
var trackStream = /* @__PURE__ */ __name((stream2, chunkSize, onProgress, onFinish) => {
|
|
2931
|
+
const iterator2 = readBytes(stream2, chunkSize);
|
|
2932
|
+
let bytes = 0;
|
|
2933
|
+
let done;
|
|
2934
|
+
let _onFinish = /* @__PURE__ */ __name((e) => {
|
|
2935
|
+
if (!done) {
|
|
2936
|
+
done = true;
|
|
2937
|
+
onFinish && onFinish(e);
|
|
2938
|
+
}
|
|
2939
|
+
}, "_onFinish");
|
|
2940
|
+
return new ReadableStream(
|
|
2941
|
+
{
|
|
2942
|
+
async pull(controller) {
|
|
2943
|
+
try {
|
|
2944
|
+
const { done: done2, value } = await iterator2.next();
|
|
2945
|
+
if (done2) {
|
|
2946
|
+
_onFinish();
|
|
2947
|
+
controller.close();
|
|
2948
|
+
return;
|
|
2949
|
+
}
|
|
2950
|
+
let len = value.byteLength;
|
|
2951
|
+
if (onProgress) {
|
|
2952
|
+
let loadedBytes = bytes += len;
|
|
2953
|
+
onProgress(loadedBytes);
|
|
2954
|
+
}
|
|
2955
|
+
controller.enqueue(new Uint8Array(value));
|
|
2956
|
+
} catch (err) {
|
|
2957
|
+
_onFinish(err);
|
|
2958
|
+
throw err;
|
|
2959
|
+
}
|
|
2960
|
+
},
|
|
2961
|
+
cancel(reason) {
|
|
2962
|
+
_onFinish(reason);
|
|
2963
|
+
return iterator2.return();
|
|
2964
|
+
}
|
|
2965
|
+
},
|
|
2966
|
+
{
|
|
2967
|
+
highWaterMark: 2
|
|
2968
|
+
}
|
|
2969
|
+
);
|
|
2970
|
+
}, "trackStream");
|
|
2971
|
+
var DEFAULT_CHUNK_SIZE = 64 * 1024;
|
|
2972
|
+
var { isFunction } = utils$1;
|
|
2973
|
+
var globalFetchAPI = (({ Request, Response }) => ({
|
|
2974
|
+
Request,
|
|
2975
|
+
Response
|
|
2976
|
+
}))(utils$1.global);
|
|
2977
|
+
var { ReadableStream: ReadableStream$1, TextEncoder: TextEncoder$1 } = utils$1.global;
|
|
2978
|
+
var test = /* @__PURE__ */ __name((fn, ...args) => {
|
|
2979
|
+
try {
|
|
2980
|
+
return !!fn(...args);
|
|
2981
|
+
} catch (e) {
|
|
2982
|
+
return false;
|
|
2983
|
+
}
|
|
2984
|
+
}, "test");
|
|
2985
|
+
var factory = /* @__PURE__ */ __name((env) => {
|
|
2986
|
+
env = utils$1.merge.call(
|
|
2987
|
+
{
|
|
2988
|
+
skipUndefined: true
|
|
2989
|
+
},
|
|
2990
|
+
globalFetchAPI,
|
|
2991
|
+
env
|
|
2992
|
+
);
|
|
2993
|
+
const { fetch: envFetch, Request, Response } = env;
|
|
2994
|
+
const isFetchSupported = envFetch ? isFunction(envFetch) : typeof fetch === "function";
|
|
2995
|
+
const isRequestSupported = isFunction(Request);
|
|
2996
|
+
const isResponseSupported = isFunction(Response);
|
|
2997
|
+
if (!isFetchSupported) {
|
|
2998
|
+
return false;
|
|
2999
|
+
}
|
|
3000
|
+
const isReadableStreamSupported = isFetchSupported && isFunction(ReadableStream$1);
|
|
3001
|
+
const encodeText = isFetchSupported && (typeof TextEncoder$1 === "function" ? /* @__PURE__ */ ((encoder) => (str) => encoder.encode(str))(new TextEncoder$1()) : async (str) => new Uint8Array(await new Request(str).arrayBuffer()));
|
|
3002
|
+
const supportsRequestStream = isRequestSupported && isReadableStreamSupported && test(() => {
|
|
3003
|
+
let duplexAccessed = false;
|
|
3004
|
+
const hasContentType = new Request(platform.origin, {
|
|
3005
|
+
body: new ReadableStream$1(),
|
|
3006
|
+
method: "POST",
|
|
3007
|
+
get duplex() {
|
|
3008
|
+
duplexAccessed = true;
|
|
3009
|
+
return "half";
|
|
3010
|
+
}
|
|
3011
|
+
}).headers.has("Content-Type");
|
|
3012
|
+
return duplexAccessed && !hasContentType;
|
|
3013
|
+
});
|
|
3014
|
+
const supportsResponseStream = isResponseSupported && isReadableStreamSupported && test(() => utils$1.isReadableStream(new Response("").body));
|
|
3015
|
+
const resolvers = {
|
|
3016
|
+
stream: supportsResponseStream && ((res) => res.body)
|
|
3017
|
+
};
|
|
3018
|
+
isFetchSupported && (() => {
|
|
3019
|
+
["text", "arrayBuffer", "blob", "formData", "stream"].forEach((type) => {
|
|
3020
|
+
!resolvers[type] && (resolvers[type] = (res, config) => {
|
|
3021
|
+
let method = res && res[type];
|
|
3022
|
+
if (method) {
|
|
3023
|
+
return method.call(res);
|
|
3024
|
+
}
|
|
3025
|
+
throw new AxiosError$1(
|
|
3026
|
+
`Response type '${type}' is not supported`,
|
|
3027
|
+
AxiosError$1.ERR_NOT_SUPPORT,
|
|
3028
|
+
config
|
|
3029
|
+
);
|
|
3030
|
+
});
|
|
3031
|
+
});
|
|
3032
|
+
})();
|
|
3033
|
+
const getBodyLength = /* @__PURE__ */ __name(async (body) => {
|
|
3034
|
+
if (body == null) {
|
|
3035
|
+
return 0;
|
|
3036
|
+
}
|
|
3037
|
+
if (utils$1.isBlob(body)) {
|
|
3038
|
+
return body.size;
|
|
3039
|
+
}
|
|
3040
|
+
if (utils$1.isSpecCompliantForm(body)) {
|
|
3041
|
+
const _request = new Request(platform.origin, {
|
|
3042
|
+
method: "POST",
|
|
3043
|
+
body
|
|
3044
|
+
});
|
|
3045
|
+
return (await _request.arrayBuffer()).byteLength;
|
|
3046
|
+
}
|
|
3047
|
+
if (utils$1.isArrayBufferView(body) || utils$1.isArrayBuffer(body)) {
|
|
3048
|
+
return body.byteLength;
|
|
3049
|
+
}
|
|
3050
|
+
if (utils$1.isURLSearchParams(body)) {
|
|
3051
|
+
body = body + "";
|
|
3052
|
+
}
|
|
3053
|
+
if (utils$1.isString(body)) {
|
|
3054
|
+
return (await encodeText(body)).byteLength;
|
|
3055
|
+
}
|
|
3056
|
+
}, "getBodyLength");
|
|
3057
|
+
const resolveBodyLength = /* @__PURE__ */ __name(async (headers, body) => {
|
|
3058
|
+
const length = utils$1.toFiniteNumber(headers.getContentLength());
|
|
3059
|
+
return length == null ? getBodyLength(body) : length;
|
|
3060
|
+
}, "resolveBodyLength");
|
|
3061
|
+
return async (config) => {
|
|
3062
|
+
let {
|
|
3063
|
+
url: url2,
|
|
3064
|
+
method,
|
|
3065
|
+
data,
|
|
3066
|
+
signal,
|
|
3067
|
+
cancelToken,
|
|
3068
|
+
timeout,
|
|
3069
|
+
onDownloadProgress,
|
|
3070
|
+
onUploadProgress,
|
|
3071
|
+
responseType,
|
|
3072
|
+
headers,
|
|
3073
|
+
withCredentials = "same-origin",
|
|
3074
|
+
fetchOptions
|
|
3075
|
+
} = resolveConfig(config);
|
|
3076
|
+
let _fetch = envFetch || fetch;
|
|
3077
|
+
responseType = responseType ? (responseType + "").toLowerCase() : "text";
|
|
3078
|
+
let composedSignal = composeSignals$1(
|
|
3079
|
+
[signal, cancelToken && cancelToken.toAbortSignal()],
|
|
3080
|
+
timeout
|
|
3081
|
+
);
|
|
3082
|
+
let request = null;
|
|
3083
|
+
const unsubscribe = composedSignal && composedSignal.unsubscribe && (() => {
|
|
3084
|
+
composedSignal.unsubscribe();
|
|
3085
|
+
});
|
|
3086
|
+
let requestContentLength;
|
|
3087
|
+
try {
|
|
3088
|
+
if (onUploadProgress && supportsRequestStream && method !== "get" && method !== "head" && (requestContentLength = await resolveBodyLength(headers, data)) !== 0) {
|
|
3089
|
+
let _request = new Request(url2, {
|
|
3090
|
+
method: "POST",
|
|
3091
|
+
body: data,
|
|
3092
|
+
duplex: "half"
|
|
3093
|
+
});
|
|
3094
|
+
let contentTypeHeader;
|
|
3095
|
+
if (utils$1.isFormData(data) && (contentTypeHeader = _request.headers.get("content-type"))) {
|
|
3096
|
+
headers.setContentType(contentTypeHeader);
|
|
3097
|
+
}
|
|
3098
|
+
if (_request.body) {
|
|
3099
|
+
const [onProgress, flush] = progressEventDecorator(
|
|
3100
|
+
requestContentLength,
|
|
3101
|
+
progressEventReducer(asyncDecorator(onUploadProgress))
|
|
3102
|
+
);
|
|
3103
|
+
data = trackStream(_request.body, DEFAULT_CHUNK_SIZE, onProgress, flush);
|
|
3104
|
+
}
|
|
3105
|
+
}
|
|
3106
|
+
if (!utils$1.isString(withCredentials)) {
|
|
3107
|
+
withCredentials = withCredentials ? "include" : "omit";
|
|
3108
|
+
}
|
|
3109
|
+
const isCredentialsSupported = isRequestSupported && "credentials" in Request.prototype;
|
|
3110
|
+
const resolvedOptions = {
|
|
3111
|
+
...fetchOptions,
|
|
3112
|
+
signal: composedSignal,
|
|
3113
|
+
method: method.toUpperCase(),
|
|
3114
|
+
headers: headers.normalize().toJSON(),
|
|
3115
|
+
body: data,
|
|
3116
|
+
duplex: "half",
|
|
3117
|
+
credentials: isCredentialsSupported ? withCredentials : void 0
|
|
3118
|
+
};
|
|
3119
|
+
request = isRequestSupported && new Request(url2, resolvedOptions);
|
|
3120
|
+
let response = await (isRequestSupported ? _fetch(request, fetchOptions) : _fetch(url2, resolvedOptions));
|
|
3121
|
+
const isStreamResponse = supportsResponseStream && (responseType === "stream" || responseType === "response");
|
|
3122
|
+
if (supportsResponseStream && (onDownloadProgress || isStreamResponse && unsubscribe)) {
|
|
3123
|
+
const options = {};
|
|
3124
|
+
["status", "statusText", "headers"].forEach((prop) => {
|
|
3125
|
+
options[prop] = response[prop];
|
|
3126
|
+
});
|
|
3127
|
+
const responseContentLength = utils$1.toFiniteNumber(response.headers.get("content-length"));
|
|
3128
|
+
const [onProgress, flush] = onDownloadProgress && progressEventDecorator(
|
|
3129
|
+
responseContentLength,
|
|
3130
|
+
progressEventReducer(asyncDecorator(onDownloadProgress), true)
|
|
3131
|
+
) || [];
|
|
3132
|
+
response = new Response(
|
|
3133
|
+
trackStream(response.body, DEFAULT_CHUNK_SIZE, onProgress, () => {
|
|
3134
|
+
flush && flush();
|
|
3135
|
+
unsubscribe && unsubscribe();
|
|
3136
|
+
}),
|
|
3137
|
+
options
|
|
3138
|
+
);
|
|
3139
|
+
}
|
|
3140
|
+
responseType = responseType || "text";
|
|
3141
|
+
let responseData = await resolvers[utils$1.findKey(resolvers, responseType) || "text"](
|
|
3142
|
+
response,
|
|
3143
|
+
config
|
|
3144
|
+
);
|
|
3145
|
+
!isStreamResponse && unsubscribe && unsubscribe();
|
|
3146
|
+
return await new Promise((resolve, reject) => {
|
|
3147
|
+
settle(resolve, reject, {
|
|
3148
|
+
data: responseData,
|
|
3149
|
+
headers: AxiosHeaders$1.from(response.headers),
|
|
3150
|
+
status: response.status,
|
|
3151
|
+
statusText: response.statusText,
|
|
3152
|
+
config,
|
|
3153
|
+
request
|
|
3154
|
+
});
|
|
3155
|
+
});
|
|
3156
|
+
} catch (err) {
|
|
3157
|
+
unsubscribe && unsubscribe();
|
|
3158
|
+
if (err && err.name === "TypeError" && /Load failed|fetch/i.test(err.message)) {
|
|
3159
|
+
throw Object.assign(
|
|
3160
|
+
new AxiosError$1(
|
|
3161
|
+
"Network Error",
|
|
3162
|
+
AxiosError$1.ERR_NETWORK,
|
|
3163
|
+
config,
|
|
3164
|
+
request,
|
|
3165
|
+
err && err.response
|
|
3166
|
+
),
|
|
3167
|
+
{
|
|
3168
|
+
cause: err.cause || err
|
|
3169
|
+
}
|
|
3170
|
+
);
|
|
3171
|
+
}
|
|
3172
|
+
throw AxiosError$1.from(err, err && err.code, config, request, err && err.response);
|
|
3173
|
+
}
|
|
3174
|
+
};
|
|
3175
|
+
}, "factory");
|
|
3176
|
+
var seedCache = /* @__PURE__ */ new Map();
|
|
3177
|
+
var getFetch = /* @__PURE__ */ __name((config) => {
|
|
3178
|
+
let env = config && config.env || {};
|
|
3179
|
+
const { fetch: fetch2, Request, Response } = env;
|
|
3180
|
+
const seeds = [Request, Response, fetch2];
|
|
3181
|
+
let len = seeds.length, i = len, seed, target, map = seedCache;
|
|
3182
|
+
while (i--) {
|
|
3183
|
+
seed = seeds[i];
|
|
3184
|
+
target = map.get(seed);
|
|
3185
|
+
target === void 0 && map.set(seed, target = i ? /* @__PURE__ */ new Map() : factory(env));
|
|
3186
|
+
map = target;
|
|
3187
|
+
}
|
|
3188
|
+
return target;
|
|
3189
|
+
}, "getFetch");
|
|
3190
|
+
getFetch();
|
|
3191
|
+
var knownAdapters = {
|
|
3192
|
+
http: httpAdapter,
|
|
3193
|
+
xhr: xhrAdapter,
|
|
3194
|
+
fetch: {
|
|
3195
|
+
get: getFetch
|
|
3196
|
+
}
|
|
3197
|
+
};
|
|
3198
|
+
utils$1.forEach(knownAdapters, (fn, value) => {
|
|
3199
|
+
if (fn) {
|
|
3200
|
+
try {
|
|
3201
|
+
Object.defineProperty(fn, "name", { value });
|
|
3202
|
+
} catch (e) {
|
|
3203
|
+
}
|
|
3204
|
+
Object.defineProperty(fn, "adapterName", { value });
|
|
3205
|
+
}
|
|
3206
|
+
});
|
|
3207
|
+
var renderReason = /* @__PURE__ */ __name((reason) => `- ${reason}`, "renderReason");
|
|
3208
|
+
var isResolvedHandle = /* @__PURE__ */ __name((adapter) => utils$1.isFunction(adapter) || adapter === null || adapter === false, "isResolvedHandle");
|
|
3209
|
+
function getAdapter(adapters2, config) {
|
|
3210
|
+
adapters2 = utils$1.isArray(adapters2) ? adapters2 : [adapters2];
|
|
3211
|
+
const { length } = adapters2;
|
|
3212
|
+
let nameOrAdapter;
|
|
3213
|
+
let adapter;
|
|
3214
|
+
const rejectedReasons = {};
|
|
3215
|
+
for (let i = 0; i < length; i++) {
|
|
3216
|
+
nameOrAdapter = adapters2[i];
|
|
3217
|
+
let id;
|
|
3218
|
+
adapter = nameOrAdapter;
|
|
3219
|
+
if (!isResolvedHandle(nameOrAdapter)) {
|
|
3220
|
+
adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()];
|
|
3221
|
+
if (adapter === void 0) {
|
|
3222
|
+
throw new AxiosError$1(`Unknown adapter '${id}'`);
|
|
3223
|
+
}
|
|
3224
|
+
}
|
|
3225
|
+
if (adapter && (utils$1.isFunction(adapter) || (adapter = adapter.get(config)))) {
|
|
3226
|
+
break;
|
|
3227
|
+
}
|
|
3228
|
+
rejectedReasons[id || "#" + i] = adapter;
|
|
3229
|
+
}
|
|
3230
|
+
if (!adapter) {
|
|
3231
|
+
const reasons = Object.entries(rejectedReasons).map(
|
|
3232
|
+
([id, state]) => `adapter ${id} ` + (state === false ? "is not supported by the environment" : "is not available in the build")
|
|
3233
|
+
);
|
|
3234
|
+
let s = length ? reasons.length > 1 ? "since :\n" + reasons.map(renderReason).join("\n") : " " + renderReason(reasons[0]) : "as no adapter specified";
|
|
3235
|
+
throw new AxiosError$1(
|
|
3236
|
+
`There is no suitable adapter to dispatch the request ` + s,
|
|
3237
|
+
"ERR_NOT_SUPPORT"
|
|
3238
|
+
);
|
|
3239
|
+
}
|
|
3240
|
+
return adapter;
|
|
3241
|
+
}
|
|
3242
|
+
__name(getAdapter, "getAdapter");
|
|
3243
|
+
var adapters = {
|
|
3244
|
+
/**
|
|
3245
|
+
* Resolve an adapter from a list of adapter names or functions.
|
|
3246
|
+
* @type {Function}
|
|
3247
|
+
*/
|
|
3248
|
+
getAdapter,
|
|
3249
|
+
/**
|
|
3250
|
+
* Exposes all known adapters
|
|
3251
|
+
* @type {Object<string, Function|Object>}
|
|
3252
|
+
*/
|
|
3253
|
+
adapters: knownAdapters
|
|
3254
|
+
};
|
|
3255
|
+
function throwIfCancellationRequested(config) {
|
|
3256
|
+
if (config.cancelToken) {
|
|
3257
|
+
config.cancelToken.throwIfRequested();
|
|
3258
|
+
}
|
|
3259
|
+
if (config.signal && config.signal.aborted) {
|
|
3260
|
+
throw new CanceledError$1(null, config);
|
|
3261
|
+
}
|
|
3262
|
+
}
|
|
3263
|
+
__name(throwIfCancellationRequested, "throwIfCancellationRequested");
|
|
3264
|
+
function dispatchRequest(config) {
|
|
3265
|
+
throwIfCancellationRequested(config);
|
|
3266
|
+
config.headers = AxiosHeaders$1.from(config.headers);
|
|
3267
|
+
config.data = transformData.call(config, config.transformRequest);
|
|
3268
|
+
if (["post", "put", "patch"].indexOf(config.method) !== -1) {
|
|
3269
|
+
config.headers.setContentType("application/x-www-form-urlencoded", false);
|
|
3270
|
+
}
|
|
3271
|
+
const adapter = adapters.getAdapter(config.adapter || defaults$1.adapter, config);
|
|
3272
|
+
return adapter(config).then(
|
|
3273
|
+
/* @__PURE__ */ __name(function onAdapterResolution(response) {
|
|
3274
|
+
throwIfCancellationRequested(config);
|
|
3275
|
+
response.data = transformData.call(config, config.transformResponse, response);
|
|
3276
|
+
response.headers = AxiosHeaders$1.from(response.headers);
|
|
3277
|
+
return response;
|
|
3278
|
+
}, "onAdapterResolution"),
|
|
3279
|
+
/* @__PURE__ */ __name(function onAdapterRejection(reason) {
|
|
3280
|
+
if (!isCancel(reason)) {
|
|
3281
|
+
throwIfCancellationRequested(config);
|
|
3282
|
+
if (reason && reason.response) {
|
|
3283
|
+
reason.response.data = transformData.call(
|
|
3284
|
+
config,
|
|
3285
|
+
config.transformResponse,
|
|
3286
|
+
reason.response
|
|
3287
|
+
);
|
|
3288
|
+
reason.response.headers = AxiosHeaders$1.from(reason.response.headers);
|
|
3289
|
+
}
|
|
3290
|
+
}
|
|
3291
|
+
return Promise.reject(reason);
|
|
3292
|
+
}, "onAdapterRejection")
|
|
3293
|
+
);
|
|
3294
|
+
}
|
|
3295
|
+
__name(dispatchRequest, "dispatchRequest");
|
|
3296
|
+
var validators$1 = {};
|
|
3297
|
+
["object", "boolean", "number", "function", "string", "symbol"].forEach((type, i) => {
|
|
3298
|
+
validators$1[type] = /* @__PURE__ */ __name(function validator2(thing) {
|
|
3299
|
+
return typeof thing === type || "a" + (i < 1 ? "n " : " ") + type;
|
|
3300
|
+
}, "validator");
|
|
3301
|
+
});
|
|
3302
|
+
var deprecatedWarnings = {};
|
|
3303
|
+
validators$1.transitional = /* @__PURE__ */ __name(function transitional(validator2, version, message) {
|
|
3304
|
+
function formatMessage(opt, desc) {
|
|
3305
|
+
return "[Axios v" + VERSION + "] Transitional option '" + opt + "'" + desc + (message ? ". " + message : "");
|
|
3306
|
+
}
|
|
3307
|
+
__name(formatMessage, "formatMessage");
|
|
3308
|
+
return (value, opt, opts) => {
|
|
3309
|
+
if (validator2 === false) {
|
|
3310
|
+
throw new AxiosError$1(
|
|
3311
|
+
formatMessage(opt, " has been removed" + (version ? " in " + version : "")),
|
|
3312
|
+
AxiosError$1.ERR_DEPRECATED
|
|
3313
|
+
);
|
|
3314
|
+
}
|
|
3315
|
+
if (version && !deprecatedWarnings[opt]) {
|
|
3316
|
+
deprecatedWarnings[opt] = true;
|
|
3317
|
+
console.warn(
|
|
3318
|
+
formatMessage(
|
|
3319
|
+
opt,
|
|
3320
|
+
" has been deprecated since v" + version + " and will be removed in the near future"
|
|
3321
|
+
)
|
|
3322
|
+
);
|
|
3323
|
+
}
|
|
3324
|
+
return validator2 ? validator2(value, opt, opts) : true;
|
|
3325
|
+
};
|
|
3326
|
+
}, "transitional");
|
|
3327
|
+
validators$1.spelling = /* @__PURE__ */ __name(function spelling(correctSpelling) {
|
|
3328
|
+
return (value, opt) => {
|
|
3329
|
+
console.warn(`${opt} is likely a misspelling of ${correctSpelling}`);
|
|
3330
|
+
return true;
|
|
3331
|
+
};
|
|
3332
|
+
}, "spelling");
|
|
3333
|
+
function assertOptions(options, schema, allowUnknown) {
|
|
3334
|
+
if (typeof options !== "object") {
|
|
3335
|
+
throw new AxiosError$1("options must be an object", AxiosError$1.ERR_BAD_OPTION_VALUE);
|
|
3336
|
+
}
|
|
3337
|
+
const keys = Object.keys(options);
|
|
3338
|
+
let i = keys.length;
|
|
3339
|
+
while (i-- > 0) {
|
|
3340
|
+
const opt = keys[i];
|
|
3341
|
+
const validator2 = schema[opt];
|
|
3342
|
+
if (validator2) {
|
|
3343
|
+
const value = options[opt];
|
|
3344
|
+
const result = value === void 0 || validator2(value, opt, options);
|
|
3345
|
+
if (result !== true) {
|
|
3346
|
+
throw new AxiosError$1(
|
|
3347
|
+
"option " + opt + " must be " + result,
|
|
3348
|
+
AxiosError$1.ERR_BAD_OPTION_VALUE
|
|
3349
|
+
);
|
|
3350
|
+
}
|
|
3351
|
+
continue;
|
|
3352
|
+
}
|
|
3353
|
+
if (allowUnknown !== true) {
|
|
3354
|
+
throw new AxiosError$1("Unknown option " + opt, AxiosError$1.ERR_BAD_OPTION);
|
|
3355
|
+
}
|
|
3356
|
+
}
|
|
3357
|
+
}
|
|
3358
|
+
__name(assertOptions, "assertOptions");
|
|
3359
|
+
var validator = {
|
|
3360
|
+
assertOptions,
|
|
3361
|
+
validators: validators$1
|
|
3362
|
+
};
|
|
3363
|
+
var validators = validator.validators;
|
|
3364
|
+
var Axios = class {
|
|
3365
|
+
static {
|
|
3366
|
+
__name(this, "Axios");
|
|
3367
|
+
}
|
|
3368
|
+
constructor(instanceConfig) {
|
|
3369
|
+
this.defaults = instanceConfig || {};
|
|
3370
|
+
this.interceptors = {
|
|
3371
|
+
request: new InterceptorManager$1(),
|
|
3372
|
+
response: new InterceptorManager$1()
|
|
3373
|
+
};
|
|
3374
|
+
}
|
|
3375
|
+
/**
|
|
3376
|
+
* Dispatch a request
|
|
3377
|
+
*
|
|
3378
|
+
* @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults)
|
|
3379
|
+
* @param {?Object} config
|
|
3380
|
+
*
|
|
3381
|
+
* @returns {Promise} The Promise to be fulfilled
|
|
3382
|
+
*/
|
|
3383
|
+
async request(configOrUrl, config) {
|
|
3384
|
+
try {
|
|
3385
|
+
return await this._request(configOrUrl, config);
|
|
3386
|
+
} catch (err) {
|
|
3387
|
+
if (err instanceof Error) {
|
|
3388
|
+
let dummy = {};
|
|
3389
|
+
Error.captureStackTrace ? Error.captureStackTrace(dummy) : dummy = new Error();
|
|
3390
|
+
const stack = dummy.stack ? dummy.stack.replace(/^.+\n/, "") : "";
|
|
3391
|
+
try {
|
|
3392
|
+
if (!err.stack) {
|
|
3393
|
+
err.stack = stack;
|
|
3394
|
+
} else if (stack && !String(err.stack).endsWith(stack.replace(/^.+\n.+\n/, ""))) {
|
|
3395
|
+
err.stack += "\n" + stack;
|
|
3396
|
+
}
|
|
3397
|
+
} catch (e) {
|
|
3398
|
+
}
|
|
3399
|
+
}
|
|
3400
|
+
throw err;
|
|
3401
|
+
}
|
|
3402
|
+
}
|
|
3403
|
+
_request(configOrUrl, config) {
|
|
3404
|
+
if (typeof configOrUrl === "string") {
|
|
3405
|
+
config = config || {};
|
|
3406
|
+
config.url = configOrUrl;
|
|
3407
|
+
} else {
|
|
3408
|
+
config = configOrUrl || {};
|
|
3409
|
+
}
|
|
3410
|
+
config = mergeConfig(this.defaults, config);
|
|
3411
|
+
const { transitional, paramsSerializer, headers } = config;
|
|
3412
|
+
if (transitional !== void 0) {
|
|
3413
|
+
validator.assertOptions(
|
|
3414
|
+
transitional,
|
|
3415
|
+
{
|
|
3416
|
+
silentJSONParsing: validators.transitional(validators.boolean),
|
|
3417
|
+
forcedJSONParsing: validators.transitional(validators.boolean),
|
|
3418
|
+
clarifyTimeoutError: validators.transitional(validators.boolean),
|
|
3419
|
+
legacyInterceptorReqResOrdering: validators.transitional(validators.boolean)
|
|
3420
|
+
},
|
|
3421
|
+
false
|
|
3422
|
+
);
|
|
3423
|
+
}
|
|
3424
|
+
if (paramsSerializer != null) {
|
|
3425
|
+
if (utils$1.isFunction(paramsSerializer)) {
|
|
3426
|
+
config.paramsSerializer = {
|
|
3427
|
+
serialize: paramsSerializer
|
|
3428
|
+
};
|
|
3429
|
+
} else {
|
|
3430
|
+
validator.assertOptions(
|
|
3431
|
+
paramsSerializer,
|
|
3432
|
+
{
|
|
3433
|
+
encode: validators.function,
|
|
3434
|
+
serialize: validators.function
|
|
3435
|
+
},
|
|
3436
|
+
true
|
|
3437
|
+
);
|
|
3438
|
+
}
|
|
3439
|
+
}
|
|
3440
|
+
if (config.allowAbsoluteUrls !== void 0) ;
|
|
3441
|
+
else if (this.defaults.allowAbsoluteUrls !== void 0) {
|
|
3442
|
+
config.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls;
|
|
3443
|
+
} else {
|
|
3444
|
+
config.allowAbsoluteUrls = true;
|
|
3445
|
+
}
|
|
3446
|
+
validator.assertOptions(
|
|
3447
|
+
config,
|
|
3448
|
+
{
|
|
3449
|
+
baseUrl: validators.spelling("baseURL"),
|
|
3450
|
+
withXsrfToken: validators.spelling("withXSRFToken")
|
|
3451
|
+
},
|
|
3452
|
+
true
|
|
3453
|
+
);
|
|
3454
|
+
config.method = (config.method || this.defaults.method || "get").toLowerCase();
|
|
3455
|
+
let contextHeaders = headers && utils$1.merge(headers.common, headers[config.method]);
|
|
3456
|
+
headers && utils$1.forEach(["delete", "get", "head", "post", "put", "patch", "common"], (method) => {
|
|
3457
|
+
delete headers[method];
|
|
3458
|
+
});
|
|
3459
|
+
config.headers = AxiosHeaders$1.concat(contextHeaders, headers);
|
|
3460
|
+
const requestInterceptorChain = [];
|
|
3461
|
+
let synchronousRequestInterceptors = true;
|
|
3462
|
+
this.interceptors.request.forEach(/* @__PURE__ */ __name(function unshiftRequestInterceptors(interceptor) {
|
|
3463
|
+
if (typeof interceptor.runWhen === "function" && interceptor.runWhen(config) === false) {
|
|
3464
|
+
return;
|
|
3465
|
+
}
|
|
3466
|
+
synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;
|
|
3467
|
+
const transitional2 = config.transitional || transitionalDefaults;
|
|
3468
|
+
const legacyInterceptorReqResOrdering = transitional2 && transitional2.legacyInterceptorReqResOrdering;
|
|
3469
|
+
if (legacyInterceptorReqResOrdering) {
|
|
3470
|
+
requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);
|
|
3471
|
+
} else {
|
|
3472
|
+
requestInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);
|
|
3473
|
+
}
|
|
3474
|
+
}, "unshiftRequestInterceptors"));
|
|
3475
|
+
const responseInterceptorChain = [];
|
|
3476
|
+
this.interceptors.response.forEach(/* @__PURE__ */ __name(function pushResponseInterceptors(interceptor) {
|
|
3477
|
+
responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);
|
|
3478
|
+
}, "pushResponseInterceptors"));
|
|
3479
|
+
let promise;
|
|
3480
|
+
let i = 0;
|
|
3481
|
+
let len;
|
|
3482
|
+
if (!synchronousRequestInterceptors) {
|
|
3483
|
+
const chain = [dispatchRequest.bind(this), void 0];
|
|
3484
|
+
chain.unshift(...requestInterceptorChain);
|
|
3485
|
+
chain.push(...responseInterceptorChain);
|
|
3486
|
+
len = chain.length;
|
|
3487
|
+
promise = Promise.resolve(config);
|
|
3488
|
+
while (i < len) {
|
|
3489
|
+
promise = promise.then(chain[i++], chain[i++]);
|
|
3490
|
+
}
|
|
3491
|
+
return promise;
|
|
3492
|
+
}
|
|
3493
|
+
len = requestInterceptorChain.length;
|
|
3494
|
+
let newConfig = config;
|
|
3495
|
+
while (i < len) {
|
|
3496
|
+
const onFulfilled = requestInterceptorChain[i++];
|
|
3497
|
+
const onRejected = requestInterceptorChain[i++];
|
|
3498
|
+
try {
|
|
3499
|
+
newConfig = onFulfilled(newConfig);
|
|
3500
|
+
} catch (error) {
|
|
3501
|
+
onRejected.call(this, error);
|
|
3502
|
+
break;
|
|
3503
|
+
}
|
|
3504
|
+
}
|
|
3505
|
+
try {
|
|
3506
|
+
promise = dispatchRequest.call(this, newConfig);
|
|
3507
|
+
} catch (error) {
|
|
3508
|
+
return Promise.reject(error);
|
|
3509
|
+
}
|
|
3510
|
+
i = 0;
|
|
3511
|
+
len = responseInterceptorChain.length;
|
|
3512
|
+
while (i < len) {
|
|
3513
|
+
promise = promise.then(responseInterceptorChain[i++], responseInterceptorChain[i++]);
|
|
3514
|
+
}
|
|
3515
|
+
return promise;
|
|
3516
|
+
}
|
|
3517
|
+
getUri(config) {
|
|
3518
|
+
config = mergeConfig(this.defaults, config);
|
|
3519
|
+
const fullPath = buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls);
|
|
3520
|
+
return buildURL(fullPath, config.params, config.paramsSerializer);
|
|
3521
|
+
}
|
|
3522
|
+
};
|
|
3523
|
+
utils$1.forEach(["delete", "get", "head", "options"], /* @__PURE__ */ __name(function forEachMethodNoData(method) {
|
|
3524
|
+
Axios.prototype[method] = function(url2, config) {
|
|
3525
|
+
return this.request(
|
|
3526
|
+
mergeConfig(config || {}, {
|
|
3527
|
+
method,
|
|
3528
|
+
url: url2,
|
|
3529
|
+
data: (config || {}).data
|
|
3530
|
+
})
|
|
3531
|
+
);
|
|
3532
|
+
};
|
|
3533
|
+
}, "forEachMethodNoData"));
|
|
3534
|
+
utils$1.forEach(["post", "put", "patch"], /* @__PURE__ */ __name(function forEachMethodWithData(method) {
|
|
3535
|
+
function generateHTTPMethod(isForm) {
|
|
3536
|
+
return /* @__PURE__ */ __name(function httpMethod(url2, data, config) {
|
|
3537
|
+
return this.request(
|
|
3538
|
+
mergeConfig(config || {}, {
|
|
3539
|
+
method,
|
|
3540
|
+
headers: isForm ? {
|
|
3541
|
+
"Content-Type": "multipart/form-data"
|
|
3542
|
+
} : {},
|
|
3543
|
+
url: url2,
|
|
3544
|
+
data
|
|
3545
|
+
})
|
|
3546
|
+
);
|
|
3547
|
+
}, "httpMethod");
|
|
3548
|
+
}
|
|
3549
|
+
__name(generateHTTPMethod, "generateHTTPMethod");
|
|
3550
|
+
Axios.prototype[method] = generateHTTPMethod();
|
|
3551
|
+
Axios.prototype[method + "Form"] = generateHTTPMethod(true);
|
|
3552
|
+
}, "forEachMethodWithData"));
|
|
3553
|
+
var Axios$1 = Axios;
|
|
3554
|
+
var CancelToken = class _CancelToken {
|
|
3555
|
+
static {
|
|
3556
|
+
__name(this, "CancelToken");
|
|
3557
|
+
}
|
|
3558
|
+
constructor(executor) {
|
|
3559
|
+
if (typeof executor !== "function") {
|
|
3560
|
+
throw new TypeError("executor must be a function.");
|
|
3561
|
+
}
|
|
3562
|
+
let resolvePromise;
|
|
3563
|
+
this.promise = new Promise(/* @__PURE__ */ __name(function promiseExecutor(resolve) {
|
|
3564
|
+
resolvePromise = resolve;
|
|
3565
|
+
}, "promiseExecutor"));
|
|
3566
|
+
const token = this;
|
|
3567
|
+
this.promise.then((cancel) => {
|
|
3568
|
+
if (!token._listeners) return;
|
|
3569
|
+
let i = token._listeners.length;
|
|
3570
|
+
while (i-- > 0) {
|
|
3571
|
+
token._listeners[i](cancel);
|
|
3572
|
+
}
|
|
3573
|
+
token._listeners = null;
|
|
3574
|
+
});
|
|
3575
|
+
this.promise.then = (onfulfilled) => {
|
|
3576
|
+
let _resolve;
|
|
3577
|
+
const promise = new Promise((resolve) => {
|
|
3578
|
+
token.subscribe(resolve);
|
|
3579
|
+
_resolve = resolve;
|
|
3580
|
+
}).then(onfulfilled);
|
|
3581
|
+
promise.cancel = /* @__PURE__ */ __name(function reject() {
|
|
3582
|
+
token.unsubscribe(_resolve);
|
|
3583
|
+
}, "reject");
|
|
3584
|
+
return promise;
|
|
3585
|
+
};
|
|
3586
|
+
executor(/* @__PURE__ */ __name(function cancel(message, config, request) {
|
|
3587
|
+
if (token.reason) {
|
|
3588
|
+
return;
|
|
3589
|
+
}
|
|
3590
|
+
token.reason = new CanceledError$1(message, config, request);
|
|
3591
|
+
resolvePromise(token.reason);
|
|
3592
|
+
}, "cancel"));
|
|
3593
|
+
}
|
|
3594
|
+
/**
|
|
3595
|
+
* Throws a `CanceledError` if cancellation has been requested.
|
|
3596
|
+
*/
|
|
3597
|
+
throwIfRequested() {
|
|
3598
|
+
if (this.reason) {
|
|
3599
|
+
throw this.reason;
|
|
3600
|
+
}
|
|
3601
|
+
}
|
|
3602
|
+
/**
|
|
3603
|
+
* Subscribe to the cancel signal
|
|
3604
|
+
*/
|
|
3605
|
+
subscribe(listener) {
|
|
3606
|
+
if (this.reason) {
|
|
3607
|
+
listener(this.reason);
|
|
3608
|
+
return;
|
|
3609
|
+
}
|
|
3610
|
+
if (this._listeners) {
|
|
3611
|
+
this._listeners.push(listener);
|
|
3612
|
+
} else {
|
|
3613
|
+
this._listeners = [listener];
|
|
3614
|
+
}
|
|
3615
|
+
}
|
|
3616
|
+
/**
|
|
3617
|
+
* Unsubscribe from the cancel signal
|
|
3618
|
+
*/
|
|
3619
|
+
unsubscribe(listener) {
|
|
3620
|
+
if (!this._listeners) {
|
|
3621
|
+
return;
|
|
3622
|
+
}
|
|
3623
|
+
const index = this._listeners.indexOf(listener);
|
|
3624
|
+
if (index !== -1) {
|
|
3625
|
+
this._listeners.splice(index, 1);
|
|
3626
|
+
}
|
|
3627
|
+
}
|
|
3628
|
+
toAbortSignal() {
|
|
3629
|
+
const controller = new AbortController();
|
|
3630
|
+
const abort = /* @__PURE__ */ __name((err) => {
|
|
3631
|
+
controller.abort(err);
|
|
3632
|
+
}, "abort");
|
|
3633
|
+
this.subscribe(abort);
|
|
3634
|
+
controller.signal.unsubscribe = () => this.unsubscribe(abort);
|
|
3635
|
+
return controller.signal;
|
|
3636
|
+
}
|
|
3637
|
+
/**
|
|
3638
|
+
* Returns an object that contains a new `CancelToken` and a function that, when called,
|
|
3639
|
+
* cancels the `CancelToken`.
|
|
3640
|
+
*/
|
|
3641
|
+
static source() {
|
|
3642
|
+
let cancel;
|
|
3643
|
+
const token = new _CancelToken(/* @__PURE__ */ __name(function executor(c) {
|
|
3644
|
+
cancel = c;
|
|
3645
|
+
}, "executor"));
|
|
3646
|
+
return {
|
|
3647
|
+
token,
|
|
3648
|
+
cancel
|
|
3649
|
+
};
|
|
3650
|
+
}
|
|
3651
|
+
};
|
|
3652
|
+
var CancelToken$1 = CancelToken;
|
|
3653
|
+
function spread(callback) {
|
|
3654
|
+
return /* @__PURE__ */ __name(function wrap(arr) {
|
|
3655
|
+
return callback.apply(null, arr);
|
|
3656
|
+
}, "wrap");
|
|
3657
|
+
}
|
|
3658
|
+
__name(spread, "spread");
|
|
3659
|
+
function isAxiosError(payload) {
|
|
3660
|
+
return utils$1.isObject(payload) && payload.isAxiosError === true;
|
|
3661
|
+
}
|
|
3662
|
+
__name(isAxiosError, "isAxiosError");
|
|
3663
|
+
var HttpStatusCode = {
|
|
3664
|
+
Continue: 100,
|
|
3665
|
+
SwitchingProtocols: 101,
|
|
3666
|
+
Processing: 102,
|
|
3667
|
+
EarlyHints: 103,
|
|
3668
|
+
Ok: 200,
|
|
3669
|
+
Created: 201,
|
|
3670
|
+
Accepted: 202,
|
|
3671
|
+
NonAuthoritativeInformation: 203,
|
|
3672
|
+
NoContent: 204,
|
|
3673
|
+
ResetContent: 205,
|
|
3674
|
+
PartialContent: 206,
|
|
3675
|
+
MultiStatus: 207,
|
|
3676
|
+
AlreadyReported: 208,
|
|
3677
|
+
ImUsed: 226,
|
|
3678
|
+
MultipleChoices: 300,
|
|
3679
|
+
MovedPermanently: 301,
|
|
3680
|
+
Found: 302,
|
|
3681
|
+
SeeOther: 303,
|
|
3682
|
+
NotModified: 304,
|
|
3683
|
+
UseProxy: 305,
|
|
3684
|
+
Unused: 306,
|
|
3685
|
+
TemporaryRedirect: 307,
|
|
3686
|
+
PermanentRedirect: 308,
|
|
3687
|
+
BadRequest: 400,
|
|
3688
|
+
Unauthorized: 401,
|
|
3689
|
+
PaymentRequired: 402,
|
|
3690
|
+
Forbidden: 403,
|
|
3691
|
+
NotFound: 404,
|
|
3692
|
+
MethodNotAllowed: 405,
|
|
3693
|
+
NotAcceptable: 406,
|
|
3694
|
+
ProxyAuthenticationRequired: 407,
|
|
3695
|
+
RequestTimeout: 408,
|
|
3696
|
+
Conflict: 409,
|
|
3697
|
+
Gone: 410,
|
|
3698
|
+
LengthRequired: 411,
|
|
3699
|
+
PreconditionFailed: 412,
|
|
3700
|
+
PayloadTooLarge: 413,
|
|
3701
|
+
UriTooLong: 414,
|
|
3702
|
+
UnsupportedMediaType: 415,
|
|
3703
|
+
RangeNotSatisfiable: 416,
|
|
3704
|
+
ExpectationFailed: 417,
|
|
3705
|
+
ImATeapot: 418,
|
|
3706
|
+
MisdirectedRequest: 421,
|
|
3707
|
+
UnprocessableEntity: 422,
|
|
3708
|
+
Locked: 423,
|
|
3709
|
+
FailedDependency: 424,
|
|
3710
|
+
TooEarly: 425,
|
|
3711
|
+
UpgradeRequired: 426,
|
|
3712
|
+
PreconditionRequired: 428,
|
|
3713
|
+
TooManyRequests: 429,
|
|
3714
|
+
RequestHeaderFieldsTooLarge: 431,
|
|
3715
|
+
UnavailableForLegalReasons: 451,
|
|
3716
|
+
InternalServerError: 500,
|
|
3717
|
+
NotImplemented: 501,
|
|
3718
|
+
BadGateway: 502,
|
|
3719
|
+
ServiceUnavailable: 503,
|
|
3720
|
+
GatewayTimeout: 504,
|
|
3721
|
+
HttpVersionNotSupported: 505,
|
|
3722
|
+
VariantAlsoNegotiates: 506,
|
|
3723
|
+
InsufficientStorage: 507,
|
|
3724
|
+
LoopDetected: 508,
|
|
3725
|
+
NotExtended: 510,
|
|
3726
|
+
NetworkAuthenticationRequired: 511,
|
|
3727
|
+
WebServerIsDown: 521,
|
|
3728
|
+
ConnectionTimedOut: 522,
|
|
3729
|
+
OriginIsUnreachable: 523,
|
|
3730
|
+
TimeoutOccurred: 524,
|
|
3731
|
+
SslHandshakeFailed: 525,
|
|
3732
|
+
InvalidSslCertificate: 526
|
|
3733
|
+
};
|
|
3734
|
+
Object.entries(HttpStatusCode).forEach(([key, value]) => {
|
|
3735
|
+
HttpStatusCode[value] = key;
|
|
3736
|
+
});
|
|
3737
|
+
var HttpStatusCode$1 = HttpStatusCode;
|
|
3738
|
+
function createInstance(defaultConfig) {
|
|
3739
|
+
const context = new Axios$1(defaultConfig);
|
|
3740
|
+
const instance = bind(Axios$1.prototype.request, context);
|
|
3741
|
+
utils$1.extend(instance, Axios$1.prototype, context, { allOwnKeys: true });
|
|
3742
|
+
utils$1.extend(instance, context, null, { allOwnKeys: true });
|
|
3743
|
+
instance.create = /* @__PURE__ */ __name(function create(instanceConfig) {
|
|
3744
|
+
return createInstance(mergeConfig(defaultConfig, instanceConfig));
|
|
3745
|
+
}, "create");
|
|
3746
|
+
return instance;
|
|
3747
|
+
}
|
|
3748
|
+
__name(createInstance, "createInstance");
|
|
3749
|
+
var axios = createInstance(defaults$1);
|
|
3750
|
+
axios.Axios = Axios$1;
|
|
3751
|
+
axios.CanceledError = CanceledError$1;
|
|
3752
|
+
axios.CancelToken = CancelToken$1;
|
|
3753
|
+
axios.isCancel = isCancel;
|
|
3754
|
+
axios.VERSION = VERSION;
|
|
3755
|
+
axios.toFormData = toFormData;
|
|
3756
|
+
axios.AxiosError = AxiosError$1;
|
|
3757
|
+
axios.Cancel = axios.CanceledError;
|
|
3758
|
+
axios.all = /* @__PURE__ */ __name(function all(promises) {
|
|
3759
|
+
return Promise.all(promises);
|
|
3760
|
+
}, "all");
|
|
3761
|
+
axios.spread = spread;
|
|
3762
|
+
axios.isAxiosError = isAxiosError;
|
|
3763
|
+
axios.mergeConfig = mergeConfig;
|
|
3764
|
+
axios.AxiosHeaders = AxiosHeaders$1;
|
|
3765
|
+
axios.formToJSON = (thing) => formDataToJSON(utils$1.isHTMLForm(thing) ? new FormData(thing) : thing);
|
|
3766
|
+
axios.getAdapter = adapters.getAdapter;
|
|
3767
|
+
axios.HttpStatusCode = HttpStatusCode$1;
|
|
3768
|
+
axios.default = axios;
|
|
3769
|
+
module.exports = axios;
|
|
3770
|
+
}
|
|
3771
|
+
});
|
|
3772
|
+
|
|
3773
|
+
// node_modules/ws/index.js
|
|
3774
|
+
var require_ws = __commonJS({
|
|
3775
|
+
"node_modules/ws/index.js"(exports, module) {
|
|
3776
|
+
"use strict";
|
|
3777
|
+
init_esbuild_shims();
|
|
3778
|
+
var createWebSocketStream = require_stream();
|
|
3779
|
+
var extension = require_extension();
|
|
3780
|
+
var PerMessageDeflate = require_permessage_deflate();
|
|
3781
|
+
var Receiver = require_receiver();
|
|
3782
|
+
var Sender = require_sender();
|
|
3783
|
+
var subprotocol = require_subprotocol();
|
|
3784
|
+
var WebSocket = require_websocket();
|
|
3785
|
+
var WebSocketServer = require_websocket_server();
|
|
3786
|
+
WebSocket.createWebSocketStream = createWebSocketStream;
|
|
3787
|
+
WebSocket.extension = extension;
|
|
3788
|
+
WebSocket.PerMessageDeflate = PerMessageDeflate;
|
|
3789
|
+
WebSocket.Receiver = Receiver;
|
|
3790
|
+
WebSocket.Sender = Sender;
|
|
3791
|
+
WebSocket.Server = WebSocketServer;
|
|
3792
|
+
WebSocket.subprotocol = subprotocol;
|
|
3793
|
+
WebSocket.WebSocket = WebSocket;
|
|
3794
|
+
WebSocket.WebSocketServer = WebSocketServer;
|
|
3795
|
+
module.exports = WebSocket;
|
|
3796
|
+
}
|
|
3797
|
+
});
|
|
3798
|
+
|
|
3799
|
+
export {
|
|
3800
|
+
require_axios,
|
|
3801
|
+
require_ws
|
|
3802
|
+
};
|
|
3803
|
+
/*! Bundled license information:
|
|
3804
|
+
|
|
3805
|
+
axios/dist/node/axios.cjs:
|
|
3806
|
+
(*! Axios v1.13.6 Copyright (c) 2026 Matt Zabriskie and contributors *)
|
|
3807
|
+
*/
|