@qwen-code/qwen-code 0.21.13 → 0.21.14-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/configuration/settings.md +13 -7
- package/bundled/qc-helper/docs/features/code-review.md +5 -1
- package/bundled/qc-helper/docs/features/commands.md +120 -8
- package/bundled/qc-helper/docs/features/sub-agents.md +2 -2
- package/bundled/qc-helper/docs/qwen-serve-deploy-local.md +1 -1
- package/bundled/qc-helper/docs/qwen-serve.md +20 -3
- package/bundled/review/SKILL.md +50 -30
- package/chunks/{MaxSizedBox-UQALOVVT.js → MaxSizedBox-3PZITE2Y.js} +24 -23
- package/chunks/{StandaloneSessionPicker-KEGXNUG6.js → StandaloneSessionPicker-2C34PNGO.js} +41 -40
- package/chunks/{acp-startup-profiler-NMDXYGDN.js → acp-startup-profiler-HUYGO57H.js} +2 -2
- package/chunks/{acpAgent-XPES32S7.js → acpAgent-3J4NHAYT.js} +626 -141
- package/chunks/{agent-DPTOZFEM.js → agent-VFX4RPP5.js} +22 -21
- package/chunks/{agent-headless-GJCQMURW.js → agent-headless-6WCF4J6N.js} +22 -21
- package/chunks/{anthropicContentGenerator-G7BVXTKN.js → anthropicContentGenerator-M7XRJMSK.js} +3 -3
- package/chunks/{bridge-YNQBAA4Z.js → bridge-XR5ZSR7U.js} +26 -25
- package/chunks/{ca-4CQ6MYNQ.js → ca-SLZJD6QH.js} +8 -0
- package/chunks/{channel-management-service-GWY2GAIC.js → channel-management-service-X6LCQUAD.js} +1 -1
- package/chunks/{channel-settings-store-WNWYFHG7.js → channel-settings-store-Z7BUEUJE.js} +30 -29
- package/chunks/{channel-worker-group-7LXCMZ77.js → channel-worker-group-TJ35JDPE.js} +2 -2
- package/chunks/{channel-worker-manager-RYEME4ZZ.js → channel-worker-manager-G5LKWGOG.js} +2 -2
- package/chunks/{chunk-MLPXSYXR.js → chunk-25GHLMQQ.js} +25 -16
- package/chunks/chunk-2C6HJMG3.js +757 -0
- package/chunks/{chunk-TUGSVUJB.js → chunk-2JXDFSVE.js} +5 -5
- package/chunks/{chunk-AS5IN4GK.js → chunk-2OA3JMRD.js} +3 -3
- package/chunks/chunk-3PWCMXIR.js +9169 -0
- package/chunks/{chunk-U3VNBPUO.js → chunk-4KQ2TI2K.js} +2 -2
- package/chunks/{chunk-NEFOOD54.js → chunk-4V4DFJBS.js} +2 -2
- package/chunks/{chunk-OMLJNPBE.js → chunk-4ZMS3JCR.js} +1 -0
- package/chunks/{chunk-PP4FUZNV.js → chunk-55PIFSP2.js} +2 -2
- package/chunks/{chunk-3U3VAL47.js → chunk-57KOJ2KZ.js} +1 -1
- package/chunks/{chunk-A4QRWUDE.js → chunk-5IYS4WWR.js} +1 -1
- package/chunks/{chunk-TS6625XH.js → chunk-5MK45KZ3.js} +9 -5
- package/chunks/{chunk-CU6GJD55.js → chunk-6DFPR7CS.js} +1 -1
- package/chunks/{chunk-V57QC6WW.js → chunk-6LAPGPVA.js} +5 -3
- package/chunks/{chunk-OOQUVWIG.js → chunk-6PDOHRN6.js} +4 -4
- package/chunks/{chunk-UZPM4XHR.js → chunk-6VDPDHIP.js} +29 -8
- package/chunks/{chunk-O4D7SPJN.js → chunk-73G3Z7QS.js} +3 -3
- package/chunks/{chunk-QIH2HAEN.js → chunk-7OCSX7FC.js} +1 -1
- package/chunks/{chunk-OVZPVYZB.js → chunk-AKBOLMUF.js} +95 -17
- package/chunks/{chunk-DGK6P3BQ.js → chunk-AQBHJ2IG.js} +10 -10
- package/chunks/{chunk-JNDY2MDR.js → chunk-BOJNAPUE.js} +1 -1
- package/chunks/{chunk-NHDR76JX.js → chunk-BQWNIPTE.js} +1 -1
- package/chunks/{chunk-AA2BEKV3.js → chunk-CH5OFRV7.js} +1 -1
- package/chunks/{chunk-MS7GNABG.js → chunk-CXJHQVEK.js} +8 -0
- package/chunks/{chunk-K5IDV3PC.js → chunk-D34RDOLP.js} +12 -2
- package/chunks/{chunk-OXCMMLED.js → chunk-DGJ7O55J.js} +1 -1
- package/chunks/{chunk-BKPPWD33.js → chunk-DRKYT2TR.js} +1 -1
- package/chunks/{chunk-P7MPQI75.js → chunk-DVR7XKO5.js} +1 -1
- package/chunks/{chunk-MRMJCLIY.js → chunk-DZCV3ZYU.js} +2 -2
- package/chunks/{chunk-EZ5RP345.js → chunk-E5RS7LF4.js} +40 -9
- package/chunks/{chunk-4NFY2S7N.js → chunk-E7REAOTN.js} +15 -0
- package/chunks/chunk-EOCQCNV4.js +3887 -0
- package/chunks/{chunk-BVJS5BSP.js → chunk-FCTLOVYW.js} +1 -1
- package/chunks/{chunk-DGZEMW5R.js → chunk-FS5NGKWC.js} +1 -1
- package/chunks/{chunk-XHRY7BXD.js → chunk-G6FFFICU.js} +3 -3
- package/chunks/{chunk-NM5V5OVW.js → chunk-GV3OIADZ.js} +2 -2
- package/chunks/{chunk-QV5YN5YD.js → chunk-HGPMOXLZ.js} +5 -5
- package/chunks/{chunk-GMIEIY3Y.js → chunk-I3N2Z25H.js} +1 -1
- package/chunks/{chunk-RIAABG2K.js → chunk-I7NTHW4C.js} +1 -1
- package/chunks/{chunk-HUTNYWBG.js → chunk-IOTPI425.js} +18 -10
- package/chunks/{chunk-ZYYTZUI2.js → chunk-ISRHAMNL.js} +3 -3
- package/chunks/{chunk-BHILXOC3.js → chunk-J63PKMYA.js} +1 -1
- package/chunks/{chunk-KD5BOPLP.js → chunk-J6YS7Z25.js} +98 -4
- package/chunks/{chunk-GO7STP6N.js → chunk-K3CECR5C.js} +4 -4
- package/chunks/{chunk-RVOJ2FBP.js → chunk-KC4WMLZO.js} +1486 -10574
- package/chunks/{chunk-IGGGG5CX.js → chunk-KSGWAYNE.js} +4580 -1652
- package/chunks/{chunk-X26JYGTD.js → chunk-L6CCLB3G.js} +1 -1
- package/chunks/{chunk-M6NDLY2T.js → chunk-LD5VIJ7S.js} +1 -1
- package/chunks/{chunk-ZYBBISBY.js → chunk-LLR424CQ.js} +15 -12
- package/chunks/{chunk-JUEPY766.js → chunk-LRDB2OLB.js} +2 -2
- package/chunks/{chunk-PQ36L4F5.js → chunk-MCG53LWC.js} +1 -1
- package/chunks/{chunk-OD2WU5QY.js → chunk-NRPXRNN4.js} +1 -1
- package/chunks/{chunk-76J3IJ3M.js → chunk-NV6LW6FT.js} +3 -3
- package/chunks/{chunk-CKSJECTU.js → chunk-NVRMCWTP.js} +8 -4
- package/chunks/{chunk-Y3YCSWG5.js → chunk-OBJYN4MX.js} +1 -1
- package/chunks/{chunk-WFSTRPRO.js → chunk-OJOP26ET.js} +1 -1
- package/chunks/{chunk-A267JX7H.js → chunk-OLZSWUZR.js} +6 -6
- package/chunks/{chunk-TIGA2IVL.js → chunk-OO4FKHLO.js} +2 -2
- package/chunks/{chunk-OY5RNSV4.js → chunk-OSAFWBNR.js} +3 -3
- package/chunks/{chunk-BZ263IKX.js → chunk-OVY67CYC.js} +1 -1
- package/chunks/{chunk-YEYY7TEP.js → chunk-P425IVUK.js} +5 -5
- package/chunks/{chunk-AFSG32D5.js → chunk-PMS7O6SA.js} +1 -1
- package/chunks/{chunk-6ORZ2EDC.js → chunk-PPTM4O4R.js} +1 -1
- package/chunks/{chunk-JOOFMXGF.js → chunk-QECSDJET.js} +5 -5
- package/chunks/{chunk-CZBYX5MY.js → chunk-QEJZUXSK.js} +1 -1
- package/chunks/{chunk-4PKCUT7F.js → chunk-QIHHJKXT.js} +6 -6
- package/chunks/{chunk-QRCNA3SR.js → chunk-RAQBBGS6.js} +49 -69
- package/chunks/{chunk-M732YJPW.js → chunk-RXHBTKMG.js} +2 -2
- package/chunks/{chunk-XIT3GURH.js → chunk-S6CXQKDD.js} +3 -3
- package/chunks/{chunk-GGDBMYGZ.js → chunk-SA7GBPEA.js} +3 -3
- package/chunks/{chunk-7UXUJ5T3.js → chunk-SBRIBTYN.js} +1 -1
- package/chunks/{chunk-MC4TLKEI.js → chunk-SGLPDKRT.js} +2 -2
- package/chunks/{chunk-WSH6GRKG.js → chunk-SLILKYV2.js} +2 -2
- package/chunks/{chunk-DXIBNLBZ.js → chunk-SNQZZ765.js} +1 -1
- package/chunks/{chunk-5EYKMUUY.js → chunk-SR2LYSMT.js} +1 -1
- package/chunks/{chunk-AW4TRXOC.js → chunk-TNPWODIZ.js} +1 -1
- package/chunks/{chunk-QF2NHSPB.js → chunk-U6RZRKNM.js} +233 -184
- package/chunks/{chunk-QNQAPSN2.js → chunk-UC67T4SF.js} +3 -1
- package/chunks/{chunk-O565M6A4.js → chunk-UYDGFWIJ.js} +199 -14
- package/chunks/{chunk-LJQAUZMR.js → chunk-VGAAAMRD.js} +925 -92
- package/chunks/{chunk-UKMR3CKV.js → chunk-VHPMDDPT.js} +3 -3
- package/chunks/{chunk-S5DWMTHO.js → chunk-WP4WIUOJ.js} +2 -0
- package/chunks/{chunk-25EYDK42.js → chunk-WPVUOVYX.js} +1 -1
- package/chunks/{chunk-AXN7UPYQ.js → chunk-WSSH2BNO.js} +1 -1
- package/chunks/{chunk-6YKYPVDV.js → chunk-WVIABDXV.js} +3 -3
- package/chunks/chunk-WZAD4ZNJ.js +59 -0
- package/chunks/{chunk-N5YPT6PH.js → chunk-X3YA3YGG.js} +7 -4
- package/chunks/{chunk-4S5337WV.js → chunk-XC377TLN.js} +4312 -2704
- package/chunks/{chunk-NNHNLJ2X.js → chunk-XO24LIZC.js} +240 -42
- package/chunks/{chunk-EL5SXY3T.js → chunk-XT4RKHVE.js} +2 -2
- package/chunks/{chunk-FDGGZIYW.js → chunk-YECDICIO.js} +2 -2
- package/chunks/{chunk-E23IPNGS.js → chunk-YFPZ3NNC.js} +12 -3
- package/chunks/{chunk-46UV252V.js → chunk-YHC2EYYG.js} +35 -38
- package/chunks/{chunk-V26NVGAU.js → chunk-YIWH3MKK.js} +8 -3
- package/chunks/{chunk-IWPYVAO2.js → chunk-YXC7JYUI.js} +2 -2
- package/chunks/{chunk-A4MFR4C5.js → chunk-ZIGC3MUS.js} +2 -4
- package/chunks/{chunk-ZZO74WKW.js → chunk-ZXEAEZFN.js} +24 -18
- package/chunks/{computer-use-77C5FHMW.js → computer-use-ABECHPS5.js} +22 -21
- package/chunks/{config-utils-IVHRSXWI.js → config-utils-NJQA5YLJ.js} +2 -2
- package/chunks/{contextCommand-PJ77GBWL.js → contextCommand-4CD5HZQQ.js} +24 -23
- package/chunks/{core-runtime-7VMIKUTG.js → core-runtime-2MOVQ4VX.js} +22 -21
- package/chunks/{create-sub-session-2L5MQRN4.js → create-sub-session-L6NNHG5N.js} +26 -24
- package/chunks/{cron-create-H7UEPDSN.js → cron-create-NFRZEOQX.js} +2 -2
- package/chunks/{cron-delete-6SZK7YFM.js → cron-delete-GFVSVO7C.js} +2 -2
- package/chunks/{cron-list-H25JIHEZ.js → cron-list-NRW34CLU.js} +2 -2
- package/chunks/{daemon-2KTG7ZBN.js → daemon-XH76IXOC.js} +356 -21
- package/chunks/{daemon-git-worktree-guard-DXYIMWFT.js → daemon-git-worktree-guard-BLXFEG4Q.js} +24 -23
- package/chunks/{daemon-status-provider-ZDOYJCU6.js → daemon-status-provider-XGD3TPTO.js} +31 -30
- package/chunks/{daemon-trust-policy-E67OYUK2.js → daemon-trust-policy-THEGCWPO.js} +29 -28
- package/chunks/{daemon-trust-policy-monitor-RYYGCQ3J.js → daemon-trust-policy-monitor-L7L4ACWQ.js} +29 -28
- package/chunks/{de-UBEBKG6V.js → de-AH4LGCF5.js} +8 -0
- package/chunks/{deferred-core-runtime-3SGXFXEQ.js → deferred-core-runtime-YQLHDUGE.js} +22 -21
- package/chunks/{discovery-ORA5J7YP.js → discovery-X2NV535U.js} +1 -1
- package/chunks/{dist-WJ4BHIEW.js → dist-ESS34DHC.js} +72 -0
- package/chunks/{earlyInputCapture-KJMLFVQV.js → earlyInputCapture-PCTXNW7N.js} +22 -21
- package/chunks/{edit-I4LQFAEC.js → edit-QX2EGWYW.js} +25 -23
- package/chunks/{en-X6YV7GME.js → en-MD3GP5YL.js} +8 -0
- package/chunks/{enter-worktree-YNPOJSRH.js → enter-worktree-EM3ZZ2SB.js} +22 -21
- package/chunks/{enterPlanMode-XCPK62ER.js → enterPlanMode-ESCMVAKB.js} +22 -21
- package/chunks/{environment-S7CTIHMX.js → environment-TOJI56YV.js} +25 -24
- package/chunks/{errors-7HB2AIDS.js → errors-DZ5FWWEM.js} +24 -23
- package/chunks/{exit-worktree-AIIY7SR6.js → exit-worktree-KUIJ36XA.js} +22 -21
- package/chunks/{exitPlanMode-R4JY7V2O.js → exitPlanMode-NFVY54FV.js} +22 -21
- package/chunks/{fast-path-NDJV3ZFJ.js → fast-path-JLQXJSH6.js} +3 -3
- package/chunks/{fast-path-settings-LNOFM2YP.js → fast-path-settings-WHX3J3ZI.js} +2 -2
- package/chunks/{fr-VENTC2BS.js → fr-ZEML2JWS.js} +8 -0
- package/chunks/{gemini-RSUFP5OE.js → gemini-I7OT4FWL.js} +62 -61
- package/chunks/{geminiContentGenerator-SQ5XBPZ7.js → geminiContentGenerator-GRIS77NJ.js} +3 -3
- package/chunks/{glob-J4RUJAHX.js → glob-7TBUUV6R.js} +22 -21
- package/chunks/{goal-tools-VHTNVOKK.js → goal-tools-K5OHOJ6B.js} +1 -1
- package/chunks/{grep-VJWPLFOT.js → grep-743SYWCZ.js} +22 -21
- package/chunks/{handleAutoUpdate-POCX2MNB.js → handleAutoUpdate-GAOYUYOD.js} +26 -25
- package/chunks/{i18n-RM5YOICI.js → i18n-2ITURYX6.js} +23 -22
- package/chunks/{image-gen-EXECB5XM.js → image-gen-4OIWDZD6.js} +2 -2
- package/chunks/{initializer-Z2AFGBNR.js → initializer-OC7LWA6X.js} +29 -28
- package/chunks/{installationInfo-4I5FXNMH.js → installationInfo-CO47QX3Q.js} +23 -22
- package/chunks/{ja-QHT4EQTO.js → ja-UM5B2HMD.js} +8 -0
- package/chunks/{list-ZMBFIGZA.js → list-ATR2SFWT.js} +32 -31
- package/chunks/{loadedSettingsAdapter-T6TV4YJ7.js → loadedSettingsAdapter-NK4B7AGK.js} +29 -28
- package/chunks/{loggingContentGenerator-WF4ZOJEZ.js → loggingContentGenerator-3WXBU5TQ.js} +12 -10
- package/chunks/{loop-wakeup-WQS6JYAG.js → loop-wakeup-HWVUU5CF.js} +3 -3
- package/chunks/{managed-npm-update-E7IW6N7V.js → managed-npm-update-4SSBWI2D.js} +23 -22
- package/chunks/{mcp-6UNYX4HG.js → mcp-C62AE2QI.js} +29 -28
- package/chunks/{monitor-EE2UYMGE.js → monitor-FEYEGASA.js} +22 -21
- package/chunks/{nonInteractiveCli-WAY237O4.js → nonInteractiveCli-AJEV5ZWO.js} +59 -57
- package/chunks/{notebook-edit-NTDY4QDU.js → notebook-edit-SLLTEY4O.js} +26 -24
- package/chunks/{openaiContentGenerator-YNFVJMRJ.js → openaiContentGenerator-WLUGIAPX.js} +12 -11
- package/chunks/{pidfile-4XSFLYBZ.js → pidfile-TV2VWUMB.js} +22 -21
- package/chunks/{processUtils-WDA2MJFD.js → processUtils-3IN2ZR55.js} +2 -2
- package/chunks/{pt-VL3I5RNY.js → pt-5BMJ3XYH.js} +8 -0
- package/chunks/{qwenContentGenerator-434M7QKY.js → qwenContentGenerator-GSGRFPJE.js} +25 -24
- package/chunks/{qwenOAuth2-GMYZOO6A.js → qwenOAuth2-JLSTIS4Z.js} +3 -3
- package/chunks/{read-file-TAFBKMNI.js → read-file-6PZZRGZZ.js} +9 -7
- package/chunks/{record-artifact-SEYFJEJF.js → record-artifact-GLU3UWBV.js} +3 -1
- package/chunks/{resumeHistoryUtils-EVG3WYK2.js → resumeHistoryUtils-5GEWKOOO.js} +25 -24
- package/chunks/{ripGrep-WOEK2PXS.js → ripGrep-FX7GBGFN.js} +22 -21
- package/chunks/{ru-4RCKL4PY.js → ru-6GL66ORV.js} +8 -0
- package/chunks/{run-qwen-serve-3QSGRXAN.js → run-qwen-serve-7RHU3NSV.js} +49 -40
- package/chunks/{runtime-5MLLZ7DC.js → runtime-EPOXAMLP.js} +32 -31
- package/chunks/{scheduler-RPBJ63CH.js → scheduler-F4Y7ENVV.js} +24 -23
- package/chunks/{sdk-exporters-http-XUVP63H6.js → sdk-exporters-http-NC746HLT.js} +2 -2
- package/chunks/{sdk-impl-YXUEN2Z2.js → sdk-impl-YVL7BP6Y.js} +2 -2
- package/chunks/{send-message-VZENRWRH.js → send-message-TNBG5EVA.js} +1 -1
- package/chunks/{serve-HS3XLPXU.js → serve-LQV4TN5A.js} +29 -30
- package/chunks/{server-TC4A7AAZ.js → server-IZCKLIYQ.js} +1267 -165
- package/chunks/{session-UBOFXVMN.js → session-52ZGTDVB.js} +60 -58
- package/chunks/{settings-D5644OM5.js → settings-WCVB34HW.js} +28 -27
- package/chunks/{shell-3PZULQQV.js → shell-33BIUBLH.js} +22 -21
- package/chunks/{skill-PEVVXQ3L.js → skill-IYVQ2QNK.js} +11 -9
- package/chunks/{skill-settings-J65JKKES.js → skill-settings-YG4ZS4OZ.js} +28 -27
- package/chunks/{spawnChannel-IYGXRHSQ.js → spawnChannel-BLA4YT4W.js} +24 -23
- package/chunks/{standalone-update-IFM53PE7.js → standalone-update-ALRIPWSM.js} +24 -23
- package/chunks/{startInteractiveUI-3AVH7L6H.js → startInteractiveUI-PISBXWKA.js} +262 -191
- package/chunks/{task-create-FCBDX7UH.js → task-create-EILHJJB7.js} +4 -4
- package/chunks/{task-list-YIYIUFUA.js → task-list-WGJR6YL5.js} +18 -4
- package/chunks/{task-update-MYPFVOVM.js → task-update-XZAHVXJ5.js} +79 -8
- package/chunks/{team-create-ZAIA7KAV.js → team-create-CIQDCC6A.js} +23 -23
- package/chunks/{team-delete-6UMU4XLS.js → team-delete-UEP4QOOT.js} +3 -3
- package/chunks/{team-plan-approval-UNIUS7OD.js → team-plan-approval-664XCRB4.js} +22 -21
- package/chunks/{terminal-image-renderer-G343P2RV.js → terminal-image-renderer-TEBO6ONY.js} +22 -21
- package/chunks/{theme-manager-Z3RIT7DB.js → theme-manager-3CIFH2JV.js} +22 -21
- package/chunks/{todoWrite-U2R4NVF4.js → todoWrite-ATS62CAP.js} +1 -1
- package/chunks/{tool-search-5R2OE4C7.js → tool-search-IJX5JHJB.js} +9 -7
- package/chunks/{total-session-admission-4KBHMQQ2.js → total-session-admission-XBK2NVRV.js} +26 -25
- package/chunks/{trustedFolders-LK6T4XC7.js → trustedFolders-OOFNLRWK.js} +23 -22
- package/chunks/{update-relaunch-UBKROIC6.js → update-relaunch-EIG7EYAQ.js} +5 -5
- package/chunks/{updateCheck-W4Y2GFSD.js → updateCheck-KYDCBLSF.js} +25 -24
- package/chunks/{useAutoAcceptIndicator-C7BEICBF.js → useAutoAcceptIndicator-RFX3KNBN.js} +31 -30
- package/chunks/{validateNonInterActiveAuth-LTEI2TB6.js → validateNonInterActiveAuth-MZXSAITU.js} +56 -54
- package/chunks/{version-G5A5DGVS.js → version-PJC6ZNXV.js} +1 -1
- package/chunks/{web-fetch-RTEQTR5Z.js → web-fetch-XXICVGKQ.js} +11 -8
- package/chunks/{web-search-5OXHEZPV.js → web-search-LHPM6QWC.js} +2 -2
- package/chunks/{workflow-ISQJHPG2.js → workflow-4CUO2BV7.js} +139 -37
- package/chunks/{workspace-providers-status-2ZPZPUPZ.js → workspace-providers-status-G4MUGH3X.js} +32 -31
- package/chunks/{workspace-registration-store-CYNY6IP6.js → workspace-registration-store-QMDMFWBE.js} +1 -1
- package/chunks/{workspace-registry-34GTUUHB.js → workspace-registry-FKBB4MZK.js} +26 -25
- package/chunks/{workspace-service-XCDQLE2Y.js → workspace-service-TIDTTA65.js} +33 -32
- package/chunks/{workspace-skills-status-RS4O7AIJ.js → workspace-skills-status-LBC2TZKM.js} +30 -29
- package/chunks/{workspace-trust-reconciler-AYGXC7A3.js → workspace-trust-reconciler-4KJ567XP.js} +33 -32
- package/chunks/{write-file-EWXKVVXF.js → write-file-R6LAEER5.js} +22 -21
- package/chunks/{zh-TW-SQ4HTSCW.js → zh-TW-LVLBK4KF.js} +8 -0
- package/chunks/{zh-LMSTK4WD.js → zh-UBMWS2BJ.js} +8 -0
- package/chunks/{zoom-image-4BFYJ3HG.js → zoom-image-XLCK6DDK.js} +14 -11
- package/cli.js +13 -13
- package/locales/ca.js +13 -0
- package/locales/de.js +12 -0
- package/locales/en.js +11 -0
- package/locales/fr.js +13 -0
- package/locales/ja.js +13 -0
- package/locales/pt.js +12 -0
- package/locales/ru.js +12 -0
- package/locales/zh-TW.js +11 -0
- package/locales/zh.js +11 -0
- package/package.json +3 -3
- package/web-shell/assets/{arc-CgOpDKvm.js → arc-DItbX0DI.js} +1 -1
- package/web-shell/assets/{architectureDiagram-3BPJPVTR-0Ag_m34F.js → architectureDiagram-3BPJPVTR-CmnIlH8y.js} +1 -1
- package/web-shell/assets/{blockDiagram-GPEHLZMM-IwTwFau0.js → blockDiagram-GPEHLZMM-pObnB9kw.js} +1 -1
- package/web-shell/assets/{c4Diagram-AAUBKEIU-DLa5GUv8.js → c4Diagram-AAUBKEIU-BNBmMS0Y.js} +1 -1
- package/web-shell/assets/channel-hZnMfWA9.js +1 -0
- package/web-shell/assets/{chunk-2J33WTMH-DcYP-WFG.js → chunk-2J33WTMH-Dz4JBOO6.js} +1 -1
- package/web-shell/assets/{chunk-4BX2VUAB-C8MVPMiQ.js → chunk-4BX2VUAB-Cz2GnvAR.js} +1 -1
- package/web-shell/assets/{chunk-55IACEB6-BUi4Yfv3.js → chunk-55IACEB6-CC6kOQYx.js} +1 -1
- package/web-shell/assets/{chunk-727SXJPM-Cy3Su2YY.js → chunk-727SXJPM-Z4lY4gbh.js} +1 -1
- package/web-shell/assets/{chunk-AQP2D5EJ-Dp8Teqv6.js → chunk-AQP2D5EJ-Yz0hZr3D.js} +1 -1
- package/web-shell/assets/{chunk-FMBD7UC4-BDTDM-4j.js → chunk-FMBD7UC4-nKmTWTv9.js} +1 -1
- package/web-shell/assets/{chunk-ND2GUHAM-7HfDt0r2.js → chunk-ND2GUHAM-CjZz0f6Y.js} +1 -1
- package/web-shell/assets/{chunk-QZHKN3VN-BIBU0uCF.js → chunk-QZHKN3VN-Bab3FpuS.js} +1 -1
- package/web-shell/assets/classDiagram-4FO5ZUOK-BRnxm8DX.js +1 -0
- package/web-shell/assets/classDiagram-v2-Q7XG4LA2-BRnxm8DX.js +1 -0
- package/web-shell/assets/{cose-bilkent-S5V4N54A-DRLdcg9p.js → cose-bilkent-S5V4N54A-BuSAGFox.js} +1 -1
- package/web-shell/assets/{dagre-BM42HDAG-DCCgDwqW.js → dagre-BM42HDAG-CRZXTg3g.js} +1 -1
- package/web-shell/assets/{diagram-2AECGRRQ-CsBTBmk3.js → diagram-2AECGRRQ-BFx1Ayrz.js} +1 -1
- package/web-shell/assets/{diagram-5GNKFQAL-C9qjH8Lt.js → diagram-5GNKFQAL-B2hMZ3gS.js} +1 -1
- package/web-shell/assets/{diagram-KO2AKTUF-Brjs_lj2.js → diagram-KO2AKTUF-DKxAQLmc.js} +1 -1
- package/web-shell/assets/{diagram-LMA3HP47-DtiWCl_F.js → diagram-LMA3HP47-Bo1xGqVY.js} +1 -1
- package/web-shell/assets/{diagram-OG6HWLK6-DmfKLkBT.js → diagram-OG6HWLK6-B9NG78d-.js} +1 -1
- package/web-shell/assets/{erDiagram-TEJ5UH35-Bve_4deH.js → erDiagram-TEJ5UH35-DltQKiqQ.js} +1 -1
- package/web-shell/assets/{flowDiagram-I6XJVG4X-C2_kXCcV.js → flowDiagram-I6XJVG4X-5xXGmS4I.js} +1 -1
- package/web-shell/assets/{ganttDiagram-6RSMTGT7-BSBIjiTF.js → ganttDiagram-6RSMTGT7-bhGL5n0l.js} +1 -1
- package/web-shell/assets/{gitGraphDiagram-PVQCEYII-CyebwI55.js → gitGraphDiagram-PVQCEYII-ZYnz9hgh.js} +1 -1
- package/web-shell/assets/{index-d0yfnV1M.js → index-CBBeUArD.js} +1 -1
- package/web-shell/assets/index-CbgU-jUo.css +5 -0
- package/web-shell/assets/index-_nhzXqab.js +1750 -0
- package/web-shell/assets/{infoDiagram-5YYISTIA-CSDGnWxU.js → infoDiagram-5YYISTIA-Cg-jamQf.js} +1 -1
- package/web-shell/assets/{ishikawaDiagram-YF4QCWOH-BK4jU13p.js → ishikawaDiagram-YF4QCWOH-CcmvKlyq.js} +1 -1
- package/web-shell/assets/{journeyDiagram-JHISSGLW-D_W6j-oF.js → journeyDiagram-JHISSGLW-BRsOQZp1.js} +1 -1
- package/web-shell/assets/{kanban-definition-UN3LZRKU-C7xf-SdC.js → kanban-definition-UN3LZRKU-xW-dmEHK.js} +1 -1
- package/web-shell/assets/{linear-DQmzxpxd.js → linear-ClBfEZH2.js} +1 -1
- package/web-shell/assets/{mermaid.core-9P7AGOLG.js → mermaid.core-D65NDkzc.js} +5 -5
- package/web-shell/assets/{mindmap-definition-RKZ34NQL-DgcgMyPk.js → mindmap-definition-RKZ34NQL-CyvFslYa.js} +1 -1
- package/web-shell/assets/{pieDiagram-4H26LBE5-3wWGb9eG.js → pieDiagram-4H26LBE5-BwSefMyG.js} +1 -1
- package/web-shell/assets/{quadrantDiagram-W4KKPZXB-BeCXnQw9.js → quadrantDiagram-W4KKPZXB-GqBJspFS.js} +1 -1
- package/web-shell/assets/{requirementDiagram-4Y6WPE33-Bi1UOHDz.js → requirementDiagram-4Y6WPE33-B137PlTJ.js} +1 -1
- package/web-shell/assets/{sankeyDiagram-5OEKKPKP-lrLUjjbb.js → sankeyDiagram-5OEKKPKP-maHkkt8i.js} +1 -1
- package/web-shell/assets/{sequenceDiagram-3UESZ5HK-BFuqKz6Q.js → sequenceDiagram-3UESZ5HK-DJ1mRaG3.js} +1 -1
- package/web-shell/assets/{stateDiagram-AJRCARHV-8DemQLhu.js → stateDiagram-AJRCARHV-aRmP7Q4i.js} +1 -1
- package/web-shell/assets/stateDiagram-v2-BHNVJYJU-Db39gvZ_.js +1 -0
- package/web-shell/assets/{timeline-definition-PNZ67QCA-uzEuVQXg.js → timeline-definition-PNZ67QCA-CIQ3BRPA.js} +1 -1
- package/web-shell/assets/{vennDiagram-CIIHVFJN-BQTeZ_-o.js → vennDiagram-CIIHVFJN-DR9VPd5h.js} +1 -1
- package/web-shell/assets/{wardley-L42UT6IY-B6yM5Im7.js → wardley-L42UT6IY-ZcfIbT4D.js} +1 -1
- package/web-shell/assets/{wardleyDiagram-YWT4CUSO-ChM8bmgn.js → wardleyDiagram-YWT4CUSO-D0jgPi4T.js} +1 -1
- package/web-shell/assets/{xychartDiagram-2RQKCTM6-oNG6HyB1.js → xychartDiagram-2RQKCTM6-BGWU4s5o.js} +1 -1
- package/web-shell/index.html +2 -2
- package/chunks/chunk-MPHPFVKK.js +0 -48
- package/chunks/chunk-RLKC46YT.js +0 -3582
- package/chunks/chunk-UPDOZBWO.js +0 -358
- package/web-shell/assets/channel-BrGVBa2L.js +0 -1
- package/web-shell/assets/classDiagram-4FO5ZUOK-B5TUzJzI.js +0 -1
- package/web-shell/assets/classDiagram-v2-Q7XG4LA2-B5TUzJzI.js +0 -1
- package/web-shell/assets/index-CIDsgxTe.js +0 -1792
- package/web-shell/assets/index-DiQnWi_E.css +0 -5
- package/web-shell/assets/stateDiagram-v2-BHNVJYJU-DhM5ixYd.js +0 -1
- /package/chunks/{chunk-NTTBXH7U.js → chunk-UGK4K2N2.js} +0 -0
|
@@ -0,0 +1,3887 @@
|
|
|
1
|
+
// Force strict mode and setup for ESM
|
|
2
|
+
"use strict";
|
|
3
|
+
import {
|
|
4
|
+
sanitizeTerminalText
|
|
5
|
+
} from "./chunk-E7REAOTN.js";
|
|
6
|
+
import {
|
|
7
|
+
formatHistoryGapNotice
|
|
8
|
+
} from "./chunk-57KOJ2KZ.js";
|
|
9
|
+
import {
|
|
10
|
+
loadUndici
|
|
11
|
+
} from "./chunk-3Z43GZUQ.js";
|
|
12
|
+
import {
|
|
13
|
+
LOAD_REPLAY_META_KEY
|
|
14
|
+
} from "./chunk-WP4WIUOJ.js";
|
|
15
|
+
import {
|
|
16
|
+
observeToolResultBoundary,
|
|
17
|
+
projectGoalStateToLegacy,
|
|
18
|
+
toolResultBoundaryArtifact
|
|
19
|
+
} from "./chunk-XC377TLN.js";
|
|
20
|
+
import {
|
|
21
|
+
parseGoalSnapshotV2,
|
|
22
|
+
parseGoalStateCause,
|
|
23
|
+
projectUserTranscriptForDisplay
|
|
24
|
+
} from "./chunk-4ZMS3JCR.js";
|
|
25
|
+
import {
|
|
26
|
+
formatVisionBridgeNoticeDisplay,
|
|
27
|
+
isVisionBridgeNoticeDisplay
|
|
28
|
+
} from "./chunk-KC4WMLZO.js";
|
|
29
|
+
import {
|
|
30
|
+
ToolNames
|
|
31
|
+
} from "./chunk-6HY6IF3Z.js";
|
|
32
|
+
import {
|
|
33
|
+
createDebugLogger
|
|
34
|
+
} from "./chunk-BUQDLC2G.js";
|
|
35
|
+
import {
|
|
36
|
+
writeStderrLine,
|
|
37
|
+
writeStderrLineSafe
|
|
38
|
+
} from "./chunk-KGJGEEVR.js";
|
|
39
|
+
import {
|
|
40
|
+
init_esbuild_shims
|
|
41
|
+
} from "./chunk-5O2XNYP6.js";
|
|
42
|
+
import {
|
|
43
|
+
__name
|
|
44
|
+
} from "./chunk-J2S4EL5Y.js";
|
|
45
|
+
|
|
46
|
+
// packages/cli/src/utils/tool-result-boundary-diagnostics.ts
|
|
47
|
+
init_esbuild_shims();
|
|
48
|
+
var acpUpdateArtifacts = /* @__PURE__ */ new WeakMap();
|
|
49
|
+
var projectedAcpUpdates = /* @__PURE__ */ new WeakMap();
|
|
50
|
+
var projectedHeadlessMessages = /* @__PURE__ */ new WeakMap();
|
|
51
|
+
function associateAcpToolResultArtifact(update, artifact) {
|
|
52
|
+
if (isObject(update)) acpUpdateArtifacts.set(update, artifact);
|
|
53
|
+
}
|
|
54
|
+
__name(associateAcpToolResultArtifact, "associateAcpToolResultArtifact");
|
|
55
|
+
function observeAcpToolResultProjection(input, output, sessionId, wireUpdate = output) {
|
|
56
|
+
try {
|
|
57
|
+
if (isObject(wireUpdate) && projectedAcpUpdates.has(wireUpdate)) return;
|
|
58
|
+
const mutated = input !== output;
|
|
59
|
+
const artifact = acpUpdateArtifacts.get(input) ?? {
|
|
60
|
+
state: "undecided",
|
|
61
|
+
kinds: []
|
|
62
|
+
};
|
|
63
|
+
const common = { sessionId, toolCallId: toolCallId(input) };
|
|
64
|
+
const inputEligible = observeToolResultBoundary({
|
|
65
|
+
stage: "acp_projection_input",
|
|
66
|
+
...common,
|
|
67
|
+
mutated,
|
|
68
|
+
artifacts: [artifact],
|
|
69
|
+
values: /* @__PURE__ */ __name(() => acpToolResultValues(input), "values")
|
|
70
|
+
});
|
|
71
|
+
const outputEligible = observeToolResultBoundary({
|
|
72
|
+
stage: "acp_projection_output",
|
|
73
|
+
...common,
|
|
74
|
+
mutated,
|
|
75
|
+
artifacts: [artifact],
|
|
76
|
+
values: /* @__PURE__ */ __name(() => acpToolResultValues(output), "values")
|
|
77
|
+
});
|
|
78
|
+
if ((inputEligible || outputEligible) && isObject(wireUpdate)) {
|
|
79
|
+
projectedAcpUpdates.set(wireUpdate, { mutated, artifact, sessionId });
|
|
80
|
+
}
|
|
81
|
+
} catch {
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
__name(observeAcpToolResultProjection, "observeAcpToolResultProjection");
|
|
85
|
+
function observeAcpToolResultWire(message, payloadUtf8Bytes) {
|
|
86
|
+
try {
|
|
87
|
+
const record = asRecord(message);
|
|
88
|
+
if (!record) return;
|
|
89
|
+
const updates = acpWireUpdates(record).flatMap((update) => {
|
|
90
|
+
const projection = projectedAcpUpdates.get(update);
|
|
91
|
+
return projection ? [{ update, projection }] : [];
|
|
92
|
+
});
|
|
93
|
+
if (updates.length === 0) return;
|
|
94
|
+
const params = asRecord(record["params"]);
|
|
95
|
+
const projectionSessionIds = new Set(
|
|
96
|
+
updates.map(({ projection }) => projection.sessionId)
|
|
97
|
+
);
|
|
98
|
+
const toolCallIds = updates.flatMap(({ update }) => {
|
|
99
|
+
const id = toolCallId(update);
|
|
100
|
+
return id === void 0 ? [] : [id];
|
|
101
|
+
});
|
|
102
|
+
observeToolResultBoundary({
|
|
103
|
+
stage: "acp_wire",
|
|
104
|
+
sessionId: typeof params?.["sessionId"] === "string" ? params["sessionId"] : projectionSessionIds.size === 1 ? projectionSessionIds.values().next().value : void 0,
|
|
105
|
+
toolCallId: updates.length === 1 ? toolCallId(updates[0].update) : void 0,
|
|
106
|
+
...updates.length > 1 ? { toolCallIds } : {},
|
|
107
|
+
wireUtf8Bytes: payloadUtf8Bytes + 1,
|
|
108
|
+
mutated: updates.some(({ projection }) => projection.mutated),
|
|
109
|
+
artifacts: updates.map(({ projection }) => projection.artifact),
|
|
110
|
+
values: /* @__PURE__ */ __name(() => updates.flatMap(
|
|
111
|
+
({ update }) => acpToolResultValues(update)
|
|
112
|
+
), "values")
|
|
113
|
+
});
|
|
114
|
+
for (const { update } of updates) projectedAcpUpdates.delete(update);
|
|
115
|
+
} catch {
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
__name(observeAcpToolResultWire, "observeAcpToolResultWire");
|
|
119
|
+
function observeHeadlessToolResultProjection(message, inputContent, outputContent, toolCallId2, artifact) {
|
|
120
|
+
try {
|
|
121
|
+
const mutated = inputContent !== outputContent;
|
|
122
|
+
const inputEligible = observeToolResultBoundary({
|
|
123
|
+
stage: "headless_projection_input",
|
|
124
|
+
sessionId: message.session_id,
|
|
125
|
+
toolCallId: toolCallId2,
|
|
126
|
+
mutated,
|
|
127
|
+
artifacts: [artifact],
|
|
128
|
+
values: [{ representation: "headless_content", value: inputContent }]
|
|
129
|
+
});
|
|
130
|
+
const outputEligible = observeToolResultBoundary({
|
|
131
|
+
stage: "headless_projection_output",
|
|
132
|
+
sessionId: message.session_id,
|
|
133
|
+
toolCallId: toolCallId2,
|
|
134
|
+
mutated,
|
|
135
|
+
artifacts: [artifact],
|
|
136
|
+
values: [{ representation: "headless_content", value: outputContent }]
|
|
137
|
+
});
|
|
138
|
+
if (inputEligible || outputEligible) {
|
|
139
|
+
projectedHeadlessMessages.set(message, {
|
|
140
|
+
mutated,
|
|
141
|
+
artifact,
|
|
142
|
+
sessionId: message.session_id
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
} catch {
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
__name(observeHeadlessToolResultProjection, "observeHeadlessToolResultProjection");
|
|
149
|
+
function observeHeadlessToolResultWire(message, frame) {
|
|
150
|
+
try {
|
|
151
|
+
if (!projectedHeadlessMessages.has(message)) return;
|
|
152
|
+
const projection = projectedHeadlessMessages.get(message);
|
|
153
|
+
const toolResults = headlessToolResults(message);
|
|
154
|
+
const values = toolResults.flatMap(toolResultValues);
|
|
155
|
+
observeToolResultBoundary({
|
|
156
|
+
stage: "headless_wire",
|
|
157
|
+
sessionId: message.session_id,
|
|
158
|
+
toolCallId: toolResults.length === 1 && typeof toolResults[0].tool_use_id === "string" ? toolResults[0].tool_use_id : void 0,
|
|
159
|
+
...toolResults.length > 1 ? {
|
|
160
|
+
toolCallIds: toolResults.map(
|
|
161
|
+
(toolResult) => toolResult.tool_use_id
|
|
162
|
+
)
|
|
163
|
+
} : {},
|
|
164
|
+
wireUtf8Bytes: Buffer.byteLength(frame, "utf8"),
|
|
165
|
+
mutated: projection.mutated,
|
|
166
|
+
artifacts: [projection.artifact],
|
|
167
|
+
values
|
|
168
|
+
});
|
|
169
|
+
projectedHeadlessMessages.delete(message);
|
|
170
|
+
} catch {
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
__name(observeHeadlessToolResultWire, "observeHeadlessToolResultWire");
|
|
174
|
+
function observeHeadlessJsonToolResultWire(messages, frame) {
|
|
175
|
+
try {
|
|
176
|
+
const observedMessages = messages.filter(
|
|
177
|
+
(message) => projectedHeadlessMessages.has(message)
|
|
178
|
+
);
|
|
179
|
+
if (observedMessages.length === 0) return;
|
|
180
|
+
const toolResults = observedMessages.flatMap(headlessToolResults);
|
|
181
|
+
const values = toolResults.flatMap(toolResultValues);
|
|
182
|
+
observeToolResultBoundary({
|
|
183
|
+
stage: "headless_wire",
|
|
184
|
+
sessionId: new Set(observedMessages.map((message) => message.session_id)).size === 1 ? observedMessages[0].session_id : void 0,
|
|
185
|
+
toolCallId: toolResults.length === 1 ? toolResults[0].tool_use_id : void 0,
|
|
186
|
+
...toolResults.length > 1 ? {
|
|
187
|
+
toolCallIds: toolResults.map(
|
|
188
|
+
(toolResult) => toolResult.tool_use_id
|
|
189
|
+
)
|
|
190
|
+
} : {},
|
|
191
|
+
wireUtf8Bytes: Buffer.byteLength(frame, "utf8"),
|
|
192
|
+
mutated: observedMessages.some(
|
|
193
|
+
(message) => projectedHeadlessMessages.get(message)?.mutated === true
|
|
194
|
+
),
|
|
195
|
+
artifacts: observedMessages.map(
|
|
196
|
+
(message) => projectedHeadlessMessages.get(message).artifact
|
|
197
|
+
),
|
|
198
|
+
values
|
|
199
|
+
});
|
|
200
|
+
for (const message of observedMessages) {
|
|
201
|
+
projectedHeadlessMessages.delete(message);
|
|
202
|
+
}
|
|
203
|
+
} catch {
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
__name(observeHeadlessJsonToolResultWire, "observeHeadlessJsonToolResultWire");
|
|
207
|
+
function acpToolResultValues(update) {
|
|
208
|
+
const record = update;
|
|
209
|
+
if (record["sessionUpdate"] !== "tool_call_update") return [];
|
|
210
|
+
const values = [];
|
|
211
|
+
const content = record["content"];
|
|
212
|
+
if (Array.isArray(content)) {
|
|
213
|
+
for (const block of content) {
|
|
214
|
+
const text = asRecord(asRecord(block)?.["content"])?.["text"];
|
|
215
|
+
if (typeof text === "string") {
|
|
216
|
+
values.push({ representation: "acp_content", value: text });
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
if (typeof record["rawOutput"] === "string") {
|
|
221
|
+
values.push({
|
|
222
|
+
representation: "acp_raw_output",
|
|
223
|
+
value: record["rawOutput"]
|
|
224
|
+
});
|
|
225
|
+
}
|
|
226
|
+
return values;
|
|
227
|
+
}
|
|
228
|
+
__name(acpToolResultValues, "acpToolResultValues");
|
|
229
|
+
function toolCallId(value) {
|
|
230
|
+
const id = asRecord(value)?.["toolCallId"];
|
|
231
|
+
return typeof id === "string" ? id : void 0;
|
|
232
|
+
}
|
|
233
|
+
__name(toolCallId, "toolCallId");
|
|
234
|
+
function acpWireUpdates(message) {
|
|
235
|
+
if (message["method"] === "session/update") {
|
|
236
|
+
const update = asRecord(asRecord(message["params"])?.["update"]);
|
|
237
|
+
return update ? [update] : [];
|
|
238
|
+
}
|
|
239
|
+
const result = asRecord(message["result"]);
|
|
240
|
+
const replay = asRecord(asRecord(result?.["_meta"])?.[LOAD_REPLAY_META_KEY]);
|
|
241
|
+
const candidates = replay?.["updates"] ?? result?.["updates"];
|
|
242
|
+
if (Array.isArray(candidates)) return candidates.filter(isObject);
|
|
243
|
+
const events = result?.["events"];
|
|
244
|
+
return Array.isArray(events) ? events.flatMap((event) => {
|
|
245
|
+
const update = asRecord(event)?.["data"];
|
|
246
|
+
return isObject(update) ? [update] : [];
|
|
247
|
+
}) : [];
|
|
248
|
+
}
|
|
249
|
+
__name(acpWireUpdates, "acpWireUpdates");
|
|
250
|
+
function headlessToolResults(message) {
|
|
251
|
+
if (message.type !== "user" || !Array.isArray(message.message.content)) {
|
|
252
|
+
return [];
|
|
253
|
+
}
|
|
254
|
+
return message.message.content.flatMap(
|
|
255
|
+
(block) => block.type === "tool_result" ? [block] : []
|
|
256
|
+
);
|
|
257
|
+
}
|
|
258
|
+
__name(headlessToolResults, "headlessToolResults");
|
|
259
|
+
function toolResultValues(toolResult) {
|
|
260
|
+
return typeof toolResult.content === "string" ? [{ representation: "headless_content", value: toolResult.content }] : [];
|
|
261
|
+
}
|
|
262
|
+
__name(toolResultValues, "toolResultValues");
|
|
263
|
+
function asRecord(value) {
|
|
264
|
+
return isObject(value) ? value : void 0;
|
|
265
|
+
}
|
|
266
|
+
__name(asRecord, "asRecord");
|
|
267
|
+
function isObject(value) {
|
|
268
|
+
return typeof value === "object" && value !== null;
|
|
269
|
+
}
|
|
270
|
+
__name(isObject, "isObject");
|
|
271
|
+
|
|
272
|
+
// packages/cli/src/acp-integration/session/history-replayer.ts
|
|
273
|
+
init_esbuild_shims();
|
|
274
|
+
|
|
275
|
+
// packages/acp-bridge/src/transcript-replay.ts
|
|
276
|
+
init_esbuild_shims();
|
|
277
|
+
|
|
278
|
+
// packages/core/dist/src/goals/goal-wire.js
|
|
279
|
+
init_esbuild_shims();
|
|
280
|
+
|
|
281
|
+
// packages/core/dist/src/goals/goal-protocol.js
|
|
282
|
+
init_esbuild_shims();
|
|
283
|
+
var GOAL_STATE_VERSION = 2;
|
|
284
|
+
var GOAL_CHECKPOINT_CLAIM_LIMIT = 32;
|
|
285
|
+
var GOAL_CHECKPOINT_CLAIM_MAX_CHARACTERS = 2e3;
|
|
286
|
+
var GOAL_CHECKPOINT_CLAIM_MAX_BYTES = 16e3;
|
|
287
|
+
var GOAL_CHECKPOINT_SOURCE_REFERENCE_LIMIT = 32;
|
|
288
|
+
function isGoalLimitKind(value) {
|
|
289
|
+
return value === "evidence_catalog" || value === "checkpoint_request";
|
|
290
|
+
}
|
|
291
|
+
__name(isGoalLimitKind, "isGoalLimitKind");
|
|
292
|
+
function isGoalEvidenceProofKind(value) {
|
|
293
|
+
return value === "user_input" || value === "delivered_output" || value === "external_fact";
|
|
294
|
+
}
|
|
295
|
+
__name(isGoalEvidenceProofKind, "isGoalEvidenceProofKind");
|
|
296
|
+
|
|
297
|
+
// packages/core/dist/src/goals/goal-reducer.js
|
|
298
|
+
init_esbuild_shims();
|
|
299
|
+
var MAX_BLOCKED_AUDIT_COUNT = 3;
|
|
300
|
+
function parseGoalStateRecordPayloadV2(value) {
|
|
301
|
+
if (!isRecord(value) || !hasOnlyKeys(value, [
|
|
302
|
+
"v",
|
|
303
|
+
"cause",
|
|
304
|
+
"snapshot",
|
|
305
|
+
"checkpointPending",
|
|
306
|
+
"blockedAudit"
|
|
307
|
+
]) || value["v"] !== GOAL_STATE_VERSION || !isGoalStateCause(value["cause"]) || !isCheckpointPending(value["checkpointPending"]) || !isBlockedAudit(value["blockedAudit"])) {
|
|
308
|
+
return void 0;
|
|
309
|
+
}
|
|
310
|
+
const parsedSnapshot = parseGoalSnapshotV22(value["snapshot"]);
|
|
311
|
+
if (parsedSnapshot?.activity !== "idle")
|
|
312
|
+
return void 0;
|
|
313
|
+
const checkpointPending = value["checkpointPending"];
|
|
314
|
+
if (checkpointPending && (parsedSnapshot.goal?.status !== "active" || checkpointPending.permit.goalId !== parsedSnapshot.goal.goalId || checkpointPending.permit.revision !== parsedSnapshot.goal.revision || checkpointPending.recordUuid === parsedSnapshot.goal.evidenceCursor.recordId || value["cause"] !== "turn_finished" && value["cause"] !== "verifier_reject")) {
|
|
315
|
+
return void 0;
|
|
316
|
+
}
|
|
317
|
+
return {
|
|
318
|
+
v: GOAL_STATE_VERSION,
|
|
319
|
+
cause: value["cause"],
|
|
320
|
+
snapshot: parsedSnapshot,
|
|
321
|
+
...checkpointPending ? { checkpointPending: structuredClone(checkpointPending) } : {},
|
|
322
|
+
...value["blockedAudit"] ? { blockedAudit: structuredClone(value["blockedAudit"]) } : {}
|
|
323
|
+
};
|
|
324
|
+
}
|
|
325
|
+
__name(parseGoalStateRecordPayloadV2, "parseGoalStateRecordPayloadV2");
|
|
326
|
+
function parseGoalSnapshotV22(value) {
|
|
327
|
+
if (!isRecord(value) || !hasOnlyKeys(value, ["v", "goal", "activity"]) || value["v"] !== GOAL_STATE_VERSION || !isGoalActivity(value["activity"])) {
|
|
328
|
+
return void 0;
|
|
329
|
+
}
|
|
330
|
+
if (value["goal"] === null) {
|
|
331
|
+
return {
|
|
332
|
+
v: GOAL_STATE_VERSION,
|
|
333
|
+
goal: null,
|
|
334
|
+
activity: value["activity"]
|
|
335
|
+
};
|
|
336
|
+
}
|
|
337
|
+
const goal = parseGoalRecord(value["goal"]);
|
|
338
|
+
return goal ? { v: GOAL_STATE_VERSION, goal, activity: value["activity"] } : void 0;
|
|
339
|
+
}
|
|
340
|
+
__name(parseGoalSnapshotV22, "parseGoalSnapshotV2");
|
|
341
|
+
function parseGoalStateCause2(value) {
|
|
342
|
+
return isGoalStateCause(value) ? value : void 0;
|
|
343
|
+
}
|
|
344
|
+
__name(parseGoalStateCause2, "parseGoalStateCause");
|
|
345
|
+
function copyCursor(cursor) {
|
|
346
|
+
return { recordId: cursor.recordId };
|
|
347
|
+
}
|
|
348
|
+
__name(copyCursor, "copyCursor");
|
|
349
|
+
function parseGoalRecord(value) {
|
|
350
|
+
if (!isRecord(value) || !hasOnlyKeys(value, [
|
|
351
|
+
"goalId",
|
|
352
|
+
"revision",
|
|
353
|
+
"objective",
|
|
354
|
+
"status",
|
|
355
|
+
"evidenceCursor",
|
|
356
|
+
"turnCount",
|
|
357
|
+
"activeTimeMs",
|
|
358
|
+
"createdAt",
|
|
359
|
+
"updatedAt",
|
|
360
|
+
"evidenceCheckpoint",
|
|
361
|
+
"lastReason",
|
|
362
|
+
"limitKind"
|
|
363
|
+
]) || typeof value["goalId"] !== "string" || !value["goalId"] || !isNonNegativeInteger(value["revision"]) || value["revision"] === 0 || typeof value["objective"] !== "string" || !value["objective"].trim() || !isGoalStatus(value["status"]) || !isTranscriptCursor(value["evidenceCursor"]) || !isNonNegativeInteger(value["turnCount"]) || !isNonNegativeNumber(value["activeTimeMs"]) || !isFiniteNumber(value["createdAt"]) || !isFiniteNumber(value["updatedAt"]) || !isGoalEvidenceCheckpoint(value["evidenceCheckpoint"]) || value["lastReason"] !== void 0 && typeof value["lastReason"] !== "string" || value["limitKind"] !== void 0 && (!isGoalLimitKind(value["limitKind"]) || value["status"] !== "usage_limited")) {
|
|
364
|
+
return void 0;
|
|
365
|
+
}
|
|
366
|
+
if (value["evidenceCheckpoint"] && value["evidenceCursor"].recordId !== value["evidenceCheckpoint"].checkpointId) {
|
|
367
|
+
return void 0;
|
|
368
|
+
}
|
|
369
|
+
return {
|
|
370
|
+
goalId: value["goalId"],
|
|
371
|
+
revision: value["revision"],
|
|
372
|
+
objective: value["objective"],
|
|
373
|
+
status: value["status"],
|
|
374
|
+
evidenceCursor: copyCursor(value["evidenceCursor"]),
|
|
375
|
+
turnCount: value["turnCount"],
|
|
376
|
+
activeTimeMs: value["activeTimeMs"],
|
|
377
|
+
createdAt: value["createdAt"],
|
|
378
|
+
updatedAt: value["updatedAt"],
|
|
379
|
+
...value["evidenceCheckpoint"] === void 0 ? {} : {
|
|
380
|
+
evidenceCheckpoint: structuredClone(value["evidenceCheckpoint"])
|
|
381
|
+
},
|
|
382
|
+
...value["lastReason"] === void 0 ? {} : { lastReason: value["lastReason"] },
|
|
383
|
+
...value["limitKind"] === void 0 ? {} : { limitKind: value["limitKind"] }
|
|
384
|
+
};
|
|
385
|
+
}
|
|
386
|
+
__name(parseGoalRecord, "parseGoalRecord");
|
|
387
|
+
function isTranscriptCursor(value) {
|
|
388
|
+
return isRecord(value) && hasOnlyKeys(value, ["recordId"]) && (typeof value["recordId"] === "string" || value["recordId"] === null);
|
|
389
|
+
}
|
|
390
|
+
__name(isTranscriptCursor, "isTranscriptCursor");
|
|
391
|
+
function isGoalStatus(value) {
|
|
392
|
+
return value === "active" || value === "paused" || value === "blocked" || value === "usage_limited" || value === "complete";
|
|
393
|
+
}
|
|
394
|
+
__name(isGoalStatus, "isGoalStatus");
|
|
395
|
+
function isGoalActivity(value) {
|
|
396
|
+
return value === "idle" || value === "running" || value === "verifying";
|
|
397
|
+
}
|
|
398
|
+
__name(isGoalActivity, "isGoalActivity");
|
|
399
|
+
function isGoalStateCause(value) {
|
|
400
|
+
return value === "create" || value === "replace" || value === "edit" || value === "pause" || value === "resume" || value === "turn_finished" || value === "checkpoint" || value === "verifier_accept" || value === "verifier_reject" || value === "complete" || value === "blocked" || value === "usage_limited" || value === "clear" || value === "migrated";
|
|
401
|
+
}
|
|
402
|
+
__name(isGoalStateCause, "isGoalStateCause");
|
|
403
|
+
function isGoalEvidenceCheckpoint(value) {
|
|
404
|
+
if (value === void 0)
|
|
405
|
+
return true;
|
|
406
|
+
if (!isRecord(value) || !hasOnlyKeys(value, ["checkpointId", "createdAt", "claims"]) || typeof value["checkpointId"] !== "string" || value["checkpointId"].length === 0 || !isFiniteNumber(value["createdAt"]) || !Array.isArray(value["claims"]) || value["claims"].length === 0 || value["claims"].length > GOAL_CHECKPOINT_CLAIM_LIMIT) {
|
|
407
|
+
return false;
|
|
408
|
+
}
|
|
409
|
+
let checkpointBytes = 0;
|
|
410
|
+
for (const [index, claim] of value["claims"].entries()) {
|
|
411
|
+
if (!isRecord(claim) || !hasOnlyKeys(claim, ["id", "proofKind", "claim", "sourceRefs"]) || claim["id"] !== `${value["checkpointId"]}:${index + 1}` || !isGoalEvidenceProofKind(claim["proofKind"]) || typeof claim["claim"] !== "string" || claim["claim"].trim().length === 0 || [...claim["claim"]].length > GOAL_CHECKPOINT_CLAIM_MAX_CHARACTERS || !Array.isArray(claim["sourceRefs"]) || claim["sourceRefs"].length === 0 || claim["sourceRefs"].length > GOAL_CHECKPOINT_SOURCE_REFERENCE_LIMIT || new Set(claim["sourceRefs"]).size !== claim["sourceRefs"].length || claim["sourceRefs"].some((reference) => typeof reference !== "string" || reference.length === 0)) {
|
|
412
|
+
return false;
|
|
413
|
+
}
|
|
414
|
+
checkpointBytes += new TextEncoder().encode(claim["claim"]).byteLength;
|
|
415
|
+
if (checkpointBytes > GOAL_CHECKPOINT_CLAIM_MAX_BYTES)
|
|
416
|
+
return false;
|
|
417
|
+
}
|
|
418
|
+
return true;
|
|
419
|
+
}
|
|
420
|
+
__name(isGoalEvidenceCheckpoint, "isGoalEvidenceCheckpoint");
|
|
421
|
+
function isCheckpointPending(value) {
|
|
422
|
+
return value === void 0 || isRecord(value) && hasOnlyKeys(value, ["permit", "recordUuid"]) && isGoalTurnPermit(value["permit"]) && typeof value["recordUuid"] === "string" && value["recordUuid"].length > 0;
|
|
423
|
+
}
|
|
424
|
+
__name(isCheckpointPending, "isCheckpointPending");
|
|
425
|
+
function isGoalTurnPermit(value) {
|
|
426
|
+
return isRecord(value) && hasOnlyKeys(value, ["goalId", "revision", "turnId"]) && typeof value["goalId"] === "string" && value["goalId"].length > 0 && isNonNegativeInteger(value["revision"]) && value["revision"] > 0 && typeof value["turnId"] === "string" && value["turnId"].length > 0;
|
|
427
|
+
}
|
|
428
|
+
__name(isGoalTurnPermit, "isGoalTurnPermit");
|
|
429
|
+
function isBlockedAudit(value) {
|
|
430
|
+
return value === void 0 || isRecord(value) && hasOnlyKeys(value, ["fingerprint", "count", "turnIds"]) && typeof value["fingerprint"] === "string" && value["fingerprint"].length > 0 && isNonNegativeInteger(value["count"]) && value["count"] > 0 && value["count"] <= MAX_BLOCKED_AUDIT_COUNT && Array.isArray(value["turnIds"]) && value["turnIds"].length === value["count"] && value["turnIds"].every((turnId) => typeof turnId === "string" && turnId.length > 0);
|
|
431
|
+
}
|
|
432
|
+
__name(isBlockedAudit, "isBlockedAudit");
|
|
433
|
+
function isRecord(value) {
|
|
434
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
435
|
+
}
|
|
436
|
+
__name(isRecord, "isRecord");
|
|
437
|
+
function hasOnlyKeys(value, keys) {
|
|
438
|
+
return Object.keys(value).every((key) => keys.includes(key));
|
|
439
|
+
}
|
|
440
|
+
__name(hasOnlyKeys, "hasOnlyKeys");
|
|
441
|
+
function isNonNegativeInteger(value) {
|
|
442
|
+
return typeof value === "number" && Number.isInteger(value) && value >= 0;
|
|
443
|
+
}
|
|
444
|
+
__name(isNonNegativeInteger, "isNonNegativeInteger");
|
|
445
|
+
function isNonNegativeNumber(value) {
|
|
446
|
+
return typeof value === "number" && Number.isFinite(value) && value >= 0;
|
|
447
|
+
}
|
|
448
|
+
__name(isNonNegativeNumber, "isNonNegativeNumber");
|
|
449
|
+
function isFiniteNumber(value) {
|
|
450
|
+
return typeof value === "number" && Number.isFinite(value);
|
|
451
|
+
}
|
|
452
|
+
__name(isFiniteNumber, "isFiniteNumber");
|
|
453
|
+
|
|
454
|
+
// packages/core/dist/src/goals/goal-legacy-projection.js
|
|
455
|
+
init_esbuild_shims();
|
|
456
|
+
function projectGoalStateToLegacy2(payload, previousGoal = null) {
|
|
457
|
+
const snapshotGoal = payload.snapshot.goal;
|
|
458
|
+
const displayGoal = snapshotGoal ?? previousGoal;
|
|
459
|
+
const kind = legacyStatusKind(payload);
|
|
460
|
+
const goalStatus = {
|
|
461
|
+
type: "goal_status",
|
|
462
|
+
kind,
|
|
463
|
+
condition: displayGoal?.objective ?? "",
|
|
464
|
+
...displayGoal ? { iterations: displayGoal.turnCount } : {},
|
|
465
|
+
...displayGoal ? { setAt: displayGoal.createdAt } : {},
|
|
466
|
+
...displayGoal ? { durationMs: displayGoal.activeTimeMs } : {},
|
|
467
|
+
...displayGoal?.lastReason === void 0 ? {} : { lastReason: displayGoal.lastReason }
|
|
468
|
+
};
|
|
469
|
+
const terminalKind = kind === "achieved" || kind === "failed" || kind === "aborted" ? kind : void 0;
|
|
470
|
+
return {
|
|
471
|
+
activeGoal: snapshotGoal?.status === "active" ? {
|
|
472
|
+
condition: snapshotGoal.objective,
|
|
473
|
+
iterations: snapshotGoal.turnCount,
|
|
474
|
+
setAt: snapshotGoal.createdAt,
|
|
475
|
+
...snapshotGoal.lastReason === void 0 ? {} : { lastReason: snapshotGoal.lastReason }
|
|
476
|
+
} : null,
|
|
477
|
+
goalStatus,
|
|
478
|
+
goalTerminal: terminalKind && displayGoal ? {
|
|
479
|
+
kind: terminalKind,
|
|
480
|
+
condition: displayGoal.objective,
|
|
481
|
+
iterations: displayGoal.turnCount,
|
|
482
|
+
durationMs: displayGoal.activeTimeMs,
|
|
483
|
+
...displayGoal.lastReason === void 0 ? {} : { lastReason: displayGoal.lastReason }
|
|
484
|
+
} : null
|
|
485
|
+
};
|
|
486
|
+
}
|
|
487
|
+
__name(projectGoalStateToLegacy2, "projectGoalStateToLegacy");
|
|
488
|
+
function isGoalCheckpointBookkeepingTransition(previous, next) {
|
|
489
|
+
const previousGoal = previous?.goal;
|
|
490
|
+
const nextGoal = next.goal;
|
|
491
|
+
if (!previousGoal || !nextGoal)
|
|
492
|
+
return false;
|
|
493
|
+
return previousGoal.goalId === nextGoal.goalId && previousGoal.revision === nextGoal.revision && previousGoal.objective === nextGoal.objective && previousGoal.status === nextGoal.status && previousGoal.turnCount === nextGoal.turnCount && previousGoal.createdAt === nextGoal.createdAt && previousGoal.lastReason === nextGoal.lastReason;
|
|
494
|
+
}
|
|
495
|
+
__name(isGoalCheckpointBookkeepingTransition, "isGoalCheckpointBookkeepingTransition");
|
|
496
|
+
function isGoalCheckpointBookkeepingCause(cause, previousCause) {
|
|
497
|
+
if (cause === "checkpoint")
|
|
498
|
+
return true;
|
|
499
|
+
return cause === "verifier_reject" && (previousCause === "verifier_reject" || previousCause === "checkpoint");
|
|
500
|
+
}
|
|
501
|
+
__name(isGoalCheckpointBookkeepingCause, "isGoalCheckpointBookkeepingCause");
|
|
502
|
+
function isGoalCheckpointBookkeepingRecord(input) {
|
|
503
|
+
return isGoalCheckpointBookkeepingTransition(input.previous, input.next) && isGoalCheckpointBookkeepingCause(input.cause, input.previousCause);
|
|
504
|
+
}
|
|
505
|
+
__name(isGoalCheckpointBookkeepingRecord, "isGoalCheckpointBookkeepingRecord");
|
|
506
|
+
function legacyStatusKind(payload) {
|
|
507
|
+
switch (payload.cause) {
|
|
508
|
+
case "create":
|
|
509
|
+
case "replace":
|
|
510
|
+
case "edit":
|
|
511
|
+
case "resume":
|
|
512
|
+
return "set";
|
|
513
|
+
case "complete":
|
|
514
|
+
return "achieved";
|
|
515
|
+
case "clear":
|
|
516
|
+
return "cleared";
|
|
517
|
+
// A migrated goal is always persisted `paused` (`createMigratedGoalState`),
|
|
518
|
+
// and nothing drives a paused goal. Projecting it as `set` would re-assert
|
|
519
|
+
// "active" to every client that derives the live goal from the newest card,
|
|
520
|
+
// leaving a phantom running goal behind a resumed pre-v2 transcript.
|
|
521
|
+
case "migrated":
|
|
522
|
+
case "pause":
|
|
523
|
+
return "paused";
|
|
524
|
+
case "blocked":
|
|
525
|
+
case "usage_limited":
|
|
526
|
+
return "aborted";
|
|
527
|
+
case "turn_finished":
|
|
528
|
+
case "checkpoint":
|
|
529
|
+
case "verifier_accept":
|
|
530
|
+
case "verifier_reject":
|
|
531
|
+
return payload.snapshot.goal?.status === "complete" ? "achieved" : payload.snapshot.goal?.status === "blocked" || payload.snapshot.goal?.status === "usage_limited" ? "aborted" : "checking";
|
|
532
|
+
default:
|
|
533
|
+
return assertNever(payload.cause);
|
|
534
|
+
}
|
|
535
|
+
}
|
|
536
|
+
__name(legacyStatusKind, "legacyStatusKind");
|
|
537
|
+
function assertNever(value) {
|
|
538
|
+
throw new Error(`Unsupported Goal state cause: ${String(value)}`);
|
|
539
|
+
}
|
|
540
|
+
__name(assertNever, "assertNever");
|
|
541
|
+
|
|
542
|
+
// packages/acp-bridge/src/transcript-replay.ts
|
|
543
|
+
var MISSING_TRANSCRIPT_TOOL_RESULT_MESSAGE = "Tool result missing from saved history; the previous run likely ended before this tool completed.";
|
|
544
|
+
var TRANSCRIPT_GOAL_STATUS_KINDS = /* @__PURE__ */ new Set([
|
|
545
|
+
"set",
|
|
546
|
+
"achieved",
|
|
547
|
+
"cleared",
|
|
548
|
+
"failed",
|
|
549
|
+
"aborted",
|
|
550
|
+
// A paused goal is not running, and dropping the card here is not neutral:
|
|
551
|
+
// the replay stream is what feeds the goal renderer, so the older `set` card
|
|
552
|
+
// stays newest and every surface keeps claiming autonomous work is under way.
|
|
553
|
+
// Kept in step with `GOAL_STATUS_KINDS`, which the daemon-side reader
|
|
554
|
+
// (`parseGoalStatusItem`) validates the same on-disk cards against.
|
|
555
|
+
"paused",
|
|
556
|
+
"checking"
|
|
557
|
+
]);
|
|
558
|
+
function isObjectRecord(value) {
|
|
559
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
560
|
+
}
|
|
561
|
+
__name(isObjectRecord, "isObjectRecord");
|
|
562
|
+
function replaceTextPartsForDisplay(parts, displayText) {
|
|
563
|
+
const projected = [];
|
|
564
|
+
let replacedText = false;
|
|
565
|
+
for (const part of parts ?? []) {
|
|
566
|
+
if (isObjectRecord(part) && typeof part["text"] === "string") {
|
|
567
|
+
if (!replacedText && displayText.length > 0) {
|
|
568
|
+
projected.push({ text: displayText });
|
|
569
|
+
}
|
|
570
|
+
replacedText = true;
|
|
571
|
+
} else {
|
|
572
|
+
projected.push(part);
|
|
573
|
+
}
|
|
574
|
+
}
|
|
575
|
+
if (!replacedText && displayText.length > 0) {
|
|
576
|
+
projected.push({ text: displayText });
|
|
577
|
+
}
|
|
578
|
+
return projected;
|
|
579
|
+
}
|
|
580
|
+
__name(replaceTextPartsForDisplay, "replaceTextPartsForDisplay");
|
|
581
|
+
function toTranscriptEpochMs(timestamp) {
|
|
582
|
+
if (typeof timestamp === "number") {
|
|
583
|
+
return Number.isFinite(timestamp) ? timestamp : void 0;
|
|
584
|
+
}
|
|
585
|
+
if (typeof timestamp !== "string") return void 0;
|
|
586
|
+
const epochMs = new Date(timestamp).getTime();
|
|
587
|
+
return Number.isFinite(epochMs) ? epochMs : void 0;
|
|
588
|
+
}
|
|
589
|
+
__name(toTranscriptEpochMs, "toTranscriptEpochMs");
|
|
590
|
+
function buildUpdateMeta(options) {
|
|
591
|
+
const timestamp = toTranscriptEpochMs(options.timestamp);
|
|
592
|
+
const sourceRecordIds = dedupeStrings(options.sourceRecordIds ?? []);
|
|
593
|
+
const qwenTranscript = {
|
|
594
|
+
...sourceRecordIds.length > 0 ? { sourceRecordIds } : {},
|
|
595
|
+
...options.planToolCallId ? { planToolCallId: options.planToolCallId } : {}
|
|
596
|
+
};
|
|
597
|
+
const meta = {
|
|
598
|
+
...options.extra ?? {},
|
|
599
|
+
...timestamp !== void 0 ? { timestamp } : {},
|
|
600
|
+
...Object.keys(qwenTranscript).length > 0 ? { qwenTranscript } : {}
|
|
601
|
+
};
|
|
602
|
+
return Object.keys(meta).length > 0 ? meta : void 0;
|
|
603
|
+
}
|
|
604
|
+
__name(buildUpdateMeta, "buildUpdateMeta");
|
|
605
|
+
function createTranscriptMessageUpdate(options) {
|
|
606
|
+
const meta = buildUpdateMeta(options);
|
|
607
|
+
return {
|
|
608
|
+
sessionUpdate: options.role === "user" ? "user_message_chunk" : options.thought ? "agent_thought_chunk" : "agent_message_chunk",
|
|
609
|
+
content: { type: "text", text: options.text },
|
|
610
|
+
...meta ? { _meta: meta } : {}
|
|
611
|
+
};
|
|
612
|
+
}
|
|
613
|
+
__name(createTranscriptMessageUpdate, "createTranscriptMessageUpdate");
|
|
614
|
+
function createTranscriptImageUpdate(options) {
|
|
615
|
+
const meta = buildUpdateMeta(options);
|
|
616
|
+
return {
|
|
617
|
+
sessionUpdate: "user_message_chunk",
|
|
618
|
+
content: { type: "image", data: options.data, mimeType: options.mimeType },
|
|
619
|
+
...meta ? { _meta: meta } : {}
|
|
620
|
+
};
|
|
621
|
+
}
|
|
622
|
+
__name(createTranscriptImageUpdate, "createTranscriptImageUpdate");
|
|
623
|
+
function createTranscriptMediaReferenceUpdate(reference, options) {
|
|
624
|
+
if (reference["type"] !== "image" && reference["type"] !== "audio" || typeof reference["mediaId"] !== "string" || typeof reference["mimeType"] !== "string" || typeof reference["size"] !== "number") {
|
|
625
|
+
return void 0;
|
|
626
|
+
}
|
|
627
|
+
const meta = buildUpdateMeta(options);
|
|
628
|
+
return {
|
|
629
|
+
sessionUpdate: "user_message_chunk",
|
|
630
|
+
content: {
|
|
631
|
+
type: reference["type"],
|
|
632
|
+
mediaId: reference["mediaId"],
|
|
633
|
+
mimeType: reference["mimeType"],
|
|
634
|
+
size: reference["size"]
|
|
635
|
+
},
|
|
636
|
+
...meta ? { _meta: meta } : {}
|
|
637
|
+
};
|
|
638
|
+
}
|
|
639
|
+
__name(createTranscriptMediaReferenceUpdate, "createTranscriptMediaReferenceUpdate");
|
|
640
|
+
function createTranscriptUsageUpdate(usageMetadata, options = {}) {
|
|
641
|
+
const usage = {
|
|
642
|
+
inputTokens: finiteNumber(usageMetadata.promptTokenCount) ?? 0,
|
|
643
|
+
outputTokens: finiteNumber(usageMetadata.candidatesTokenCount) ?? 0,
|
|
644
|
+
totalTokens: finiteNumber(usageMetadata.totalTokenCount) ?? 0,
|
|
645
|
+
...finiteNumber(usageMetadata.thoughtsTokenCount) !== void 0 ? { thoughtTokens: finiteNumber(usageMetadata.thoughtsTokenCount) } : {},
|
|
646
|
+
...finiteNumber(usageMetadata.cachedContentTokenCount) !== void 0 ? {
|
|
647
|
+
cachedReadTokens: finiteNumber(usageMetadata.cachedContentTokenCount)
|
|
648
|
+
} : {}
|
|
649
|
+
};
|
|
650
|
+
const meta = buildUpdateMeta({
|
|
651
|
+
...options,
|
|
652
|
+
extra: { usage, ...options.extra ?? {} }
|
|
653
|
+
});
|
|
654
|
+
return {
|
|
655
|
+
sessionUpdate: "agent_message_chunk",
|
|
656
|
+
content: { type: "text", text: options.text ?? "" },
|
|
657
|
+
_meta: meta
|
|
658
|
+
};
|
|
659
|
+
}
|
|
660
|
+
__name(createTranscriptUsageUpdate, "createTranscriptUsageUpdate");
|
|
661
|
+
function createTranscriptToolCallStartUpdate(options) {
|
|
662
|
+
const provenance = resolveToolProvenance(options.toolName);
|
|
663
|
+
return {
|
|
664
|
+
sessionUpdate: options.asUpdate ? "tool_call_update" : "tool_call",
|
|
665
|
+
toolCallId: options.callId,
|
|
666
|
+
status: options.status ?? "pending",
|
|
667
|
+
title: options.metadata.title,
|
|
668
|
+
content: [],
|
|
669
|
+
locations: [...options.metadata.locations],
|
|
670
|
+
kind: options.metadata.kind,
|
|
671
|
+
rawInput: options.args ?? {},
|
|
672
|
+
_meta: buildUpdateMeta({
|
|
673
|
+
...options,
|
|
674
|
+
extra: {
|
|
675
|
+
toolName: options.toolName,
|
|
676
|
+
provenance: provenance.provenance,
|
|
677
|
+
...provenance.serverId ? { serverId: provenance.serverId } : {},
|
|
678
|
+
...options.extra ?? {}
|
|
679
|
+
}
|
|
680
|
+
})
|
|
681
|
+
};
|
|
682
|
+
}
|
|
683
|
+
__name(createTranscriptToolCallStartUpdate, "createTranscriptToolCallStartUpdate");
|
|
684
|
+
function createTranscriptToolCallResultUpdate(options) {
|
|
685
|
+
const provenance = resolveToolProvenance(options.toolName);
|
|
686
|
+
const content = buildToolResultContent(options);
|
|
687
|
+
const update = {
|
|
688
|
+
sessionUpdate: "tool_call_update",
|
|
689
|
+
toolCallId: options.callId,
|
|
690
|
+
status: options.success ? "completed" : "failed",
|
|
691
|
+
content,
|
|
692
|
+
_meta: buildUpdateMeta({
|
|
693
|
+
...options,
|
|
694
|
+
extra: {
|
|
695
|
+
toolName: options.toolName,
|
|
696
|
+
provenance: provenance.provenance,
|
|
697
|
+
...provenance.serverId ? { serverId: provenance.serverId } : {},
|
|
698
|
+
...options.artifacts && options.artifacts.length > 0 ? { artifacts: options.artifacts } : {},
|
|
699
|
+
...options.extra ?? {}
|
|
700
|
+
}
|
|
701
|
+
})
|
|
702
|
+
};
|
|
703
|
+
if (options.resultDisplay !== void 0 && !isTruncatedSessionDiffDisplay(options.resultDisplay)) {
|
|
704
|
+
update["rawOutput"] = options.resultDisplay;
|
|
705
|
+
}
|
|
706
|
+
return update;
|
|
707
|
+
}
|
|
708
|
+
__name(createTranscriptToolCallResultUpdate, "createTranscriptToolCallResultUpdate");
|
|
709
|
+
function createTranscriptPlanUpdate(todos, cumulativeUsage, options = {}) {
|
|
710
|
+
const meta = buildUpdateMeta({
|
|
711
|
+
...options,
|
|
712
|
+
extra: {
|
|
713
|
+
...cumulativeUsage ? { stats: { ...cumulativeUsage } } : {},
|
|
714
|
+
...options.todoPlanId ? { qwenTodoPlan: { id: options.todoPlanId } } : {},
|
|
715
|
+
...options.extra ?? {}
|
|
716
|
+
}
|
|
717
|
+
});
|
|
718
|
+
return {
|
|
719
|
+
sessionUpdate: "plan",
|
|
720
|
+
entries: todos.map((todo) => ({
|
|
721
|
+
content: todo.content,
|
|
722
|
+
priority: "medium",
|
|
723
|
+
status: todo.status,
|
|
724
|
+
...todo.id || todo.blockedBy ? {
|
|
725
|
+
_meta: {
|
|
726
|
+
qwenTodo: {
|
|
727
|
+
...todo.id ? { id: todo.id } : {},
|
|
728
|
+
...todo.blockedBy ? { blockedBy: [...todo.blockedBy] } : {}
|
|
729
|
+
}
|
|
730
|
+
}
|
|
731
|
+
} : {}
|
|
732
|
+
})),
|
|
733
|
+
...meta ? { _meta: meta } : {}
|
|
734
|
+
};
|
|
735
|
+
}
|
|
736
|
+
__name(createTranscriptPlanUpdate, "createTranscriptPlanUpdate");
|
|
737
|
+
function extractTranscriptTodoPlan(resultDisplay, args) {
|
|
738
|
+
const fromDisplay = extractTodoPlanFromDisplay(resultDisplay);
|
|
739
|
+
if (fromDisplay) return fromDisplay;
|
|
740
|
+
if (resultDisplay !== null && resultDisplay !== void 0) return null;
|
|
741
|
+
return args && Array.isArray(args["todos"]) ? { todos: normalizeTodos(args["todos"]) } : null;
|
|
742
|
+
}
|
|
743
|
+
__name(extractTranscriptTodoPlan, "extractTranscriptTodoPlan");
|
|
744
|
+
function createTranscriptReplayMachine(options = {}) {
|
|
745
|
+
return new DefaultTranscriptReplayMachine(options);
|
|
746
|
+
}
|
|
747
|
+
__name(createTranscriptReplayMachine, "createTranscriptReplayMachine");
|
|
748
|
+
var DefaultTranscriptReplayMachine = class {
|
|
749
|
+
constructor(options) {
|
|
750
|
+
this.options = options;
|
|
751
|
+
const initialState = parseInitialState(
|
|
752
|
+
options.initialState,
|
|
753
|
+
options.onDiagnostic
|
|
754
|
+
);
|
|
755
|
+
this.usage = { ...initialState.cumulativeUsage };
|
|
756
|
+
this.goalState = initialState.goalState;
|
|
757
|
+
this.goalCause = initialState.goalCause;
|
|
758
|
+
for (const pending of initialState.pendingToolCalls) {
|
|
759
|
+
this.pendingToolCalls.set(pending.callId, pending);
|
|
760
|
+
this.usedToolCallIds.add(pending.callId);
|
|
761
|
+
}
|
|
762
|
+
for (const gap of options.gaps ?? []) {
|
|
763
|
+
if (!this.gapByChild.has(gap.childUuid)) {
|
|
764
|
+
this.gapByChild.set(gap.childUuid, gap);
|
|
765
|
+
}
|
|
766
|
+
}
|
|
767
|
+
}
|
|
768
|
+
static {
|
|
769
|
+
__name(this, "DefaultTranscriptReplayMachine");
|
|
770
|
+
}
|
|
771
|
+
pendingToolCalls = /* @__PURE__ */ new Map();
|
|
772
|
+
usedToolCallIds = /* @__PURE__ */ new Set();
|
|
773
|
+
gapByChild = /* @__PURE__ */ new Map();
|
|
774
|
+
usage;
|
|
775
|
+
finalized = false;
|
|
776
|
+
goalState;
|
|
777
|
+
goalCause;
|
|
778
|
+
*project(record) {
|
|
779
|
+
if (this.finalized) {
|
|
780
|
+
throw new Error(
|
|
781
|
+
"Cannot project records after transcript replay finalize."
|
|
782
|
+
);
|
|
783
|
+
}
|
|
784
|
+
let ordinal = 0;
|
|
785
|
+
const emit = /* @__PURE__ */ __name((update) => ({
|
|
786
|
+
sourceRecordId: record.uuid,
|
|
787
|
+
...record.timestamp ? { sourceTimestamp: record.timestamp } : {},
|
|
788
|
+
emissionOrdinal: ordinal++,
|
|
789
|
+
update
|
|
790
|
+
}), "emit");
|
|
791
|
+
const meta = {
|
|
792
|
+
timestamp: record.timestamp,
|
|
793
|
+
sourceRecordIds: [record.uuid],
|
|
794
|
+
...record.subtype === "realtime_message" ? {
|
|
795
|
+
extra: {
|
|
796
|
+
source: "realtime_voice",
|
|
797
|
+
qwenDiscreteMessage: true
|
|
798
|
+
}
|
|
799
|
+
} : {}
|
|
800
|
+
};
|
|
801
|
+
const gap = this.gapByChild.get(record.uuid);
|
|
802
|
+
if (gap) {
|
|
803
|
+
yield emit(
|
|
804
|
+
createTranscriptMessageUpdate({
|
|
805
|
+
role: "assistant",
|
|
806
|
+
text: this.formatGap(gap),
|
|
807
|
+
...meta,
|
|
808
|
+
extra: { qwenDiscreteMessage: true }
|
|
809
|
+
})
|
|
810
|
+
);
|
|
811
|
+
}
|
|
812
|
+
switch (record.type) {
|
|
813
|
+
case "user":
|
|
814
|
+
yield* this.projectUserRecord(record, emit, meta);
|
|
815
|
+
break;
|
|
816
|
+
case "assistant":
|
|
817
|
+
yield* this.projectAssistantRecord(record, emit, meta);
|
|
818
|
+
break;
|
|
819
|
+
case "tool_result":
|
|
820
|
+
yield* this.projectToolResult(record, emit, meta);
|
|
821
|
+
break;
|
|
822
|
+
case "system":
|
|
823
|
+
yield* this.projectSystemRecord(record, emit, meta);
|
|
824
|
+
break;
|
|
825
|
+
default:
|
|
826
|
+
this.report(
|
|
827
|
+
"unknown_record_or_part",
|
|
828
|
+
"Skipped an unknown transcript record type.",
|
|
829
|
+
record.uuid
|
|
830
|
+
);
|
|
831
|
+
}
|
|
832
|
+
}
|
|
833
|
+
*finalize() {
|
|
834
|
+
if (this.finalized) return;
|
|
835
|
+
this.finalized = true;
|
|
836
|
+
let ordinal = 0;
|
|
837
|
+
for (const pending of [...this.pendingToolCalls.values()]) {
|
|
838
|
+
this.pendingToolCalls.delete(pending.callId);
|
|
839
|
+
this.report(
|
|
840
|
+
"missing_tool_result",
|
|
841
|
+
"A transcript tool call has no persisted result.",
|
|
842
|
+
pending.sourceRecordId
|
|
843
|
+
);
|
|
844
|
+
yield {
|
|
845
|
+
sourceRecordId: pending.sourceRecordId,
|
|
846
|
+
...pending.sourceTimestamp ? { sourceTimestamp: pending.sourceTimestamp } : {},
|
|
847
|
+
emissionOrdinal: ordinal++,
|
|
848
|
+
update: createTranscriptToolCallResultUpdate({
|
|
849
|
+
toolName: pending.toolName,
|
|
850
|
+
callId: pending.callId,
|
|
851
|
+
success: false,
|
|
852
|
+
errorMessage: MISSING_TRANSCRIPT_TOOL_RESULT_MESSAGE,
|
|
853
|
+
timestamp: pending.sourceTimestamp,
|
|
854
|
+
sourceRecordIds: [pending.sourceRecordId]
|
|
855
|
+
})
|
|
856
|
+
};
|
|
857
|
+
}
|
|
858
|
+
}
|
|
859
|
+
snapshot() {
|
|
860
|
+
return {
|
|
861
|
+
v: 1,
|
|
862
|
+
pendingToolCalls: [...this.pendingToolCalls.values()].map((pending) => ({
|
|
863
|
+
...pending
|
|
864
|
+
})),
|
|
865
|
+
cumulativeUsage: { ...this.usage },
|
|
866
|
+
...this.goalState ? { goalState: this.goalState } : {},
|
|
867
|
+
...this.goalCause ? { goalCause: this.goalCause } : {}
|
|
868
|
+
};
|
|
869
|
+
}
|
|
870
|
+
*projectUserRecord(record, emit, meta) {
|
|
871
|
+
const payload = isObjectRecord(record.systemPayload) ? record.systemPayload : void 0;
|
|
872
|
+
const replayMeta = record.subtype === "mid_turn_user_message" ? {
|
|
873
|
+
...meta,
|
|
874
|
+
extra: {
|
|
875
|
+
...meta.extra,
|
|
876
|
+
source: "mid_turn_message_injected",
|
|
877
|
+
qwenDiscreteMessage: true
|
|
878
|
+
}
|
|
879
|
+
} : meta;
|
|
880
|
+
if (record.subtype === "goal_runtime" || record.subtype === "notification" || record.subtype === "cron" || record.subtype === "mid_turn_user_message") {
|
|
881
|
+
const displayText = payload && typeof payload["displayText"] === "string" ? payload["displayText"] : void 0;
|
|
882
|
+
if (record.subtype === "mid_turn_user_message" && displayText === "") {
|
|
883
|
+
const media = [
|
|
884
|
+
...this.projectUserMediaReferences(payload, emit, replayMeta)
|
|
885
|
+
];
|
|
886
|
+
if (media.length > 0) {
|
|
887
|
+
yield* media;
|
|
888
|
+
return;
|
|
889
|
+
}
|
|
890
|
+
}
|
|
891
|
+
if (displayText) {
|
|
892
|
+
const isNotification = record.subtype === "notification";
|
|
893
|
+
const backgroundTask = payload && isObjectRecord(payload["backgroundTask"]) ? payload["backgroundTask"] : void 0;
|
|
894
|
+
yield emit(
|
|
895
|
+
createTranscriptMessageUpdate({
|
|
896
|
+
role: "user",
|
|
897
|
+
text: displayText,
|
|
898
|
+
...replayMeta,
|
|
899
|
+
...isNotification ? {
|
|
900
|
+
extra: {
|
|
901
|
+
source: "background_notification",
|
|
902
|
+
qwenDiscreteMessage: true,
|
|
903
|
+
...backgroundTask ? { backgroundTask } : {}
|
|
904
|
+
}
|
|
905
|
+
} : record.subtype === "cron" ? { extra: { source: "cron" } } : {}
|
|
906
|
+
})
|
|
907
|
+
);
|
|
908
|
+
yield* this.projectUserMediaReferences(payload, emit, replayMeta);
|
|
909
|
+
return;
|
|
910
|
+
}
|
|
911
|
+
if (record.subtype !== "mid_turn_user_message") return;
|
|
912
|
+
}
|
|
913
|
+
const projection = projectUserTranscriptForDisplay(record);
|
|
914
|
+
if (projection.displayText !== void 0) {
|
|
915
|
+
yield* this.projectMessageParts(
|
|
916
|
+
record,
|
|
917
|
+
"user",
|
|
918
|
+
emit,
|
|
919
|
+
replayMeta,
|
|
920
|
+
void 0,
|
|
921
|
+
replaceTextPartsForDisplay(
|
|
922
|
+
record.message?.parts,
|
|
923
|
+
projection.displayText
|
|
924
|
+
)
|
|
925
|
+
);
|
|
926
|
+
yield* this.projectUserMediaReferences(payload, emit, replayMeta);
|
|
927
|
+
return;
|
|
928
|
+
}
|
|
929
|
+
yield* this.projectMessageParts(
|
|
930
|
+
record,
|
|
931
|
+
"user",
|
|
932
|
+
emit,
|
|
933
|
+
replayMeta,
|
|
934
|
+
void 0,
|
|
935
|
+
projection.parts
|
|
936
|
+
);
|
|
937
|
+
yield* this.projectUserMediaReferences(payload, emit, replayMeta);
|
|
938
|
+
}
|
|
939
|
+
*projectUserMediaReferences(payload, emit, meta) {
|
|
940
|
+
const references = payload?.["mediaReferences"];
|
|
941
|
+
if (!Array.isArray(references)) return;
|
|
942
|
+
for (const reference of references) {
|
|
943
|
+
if (!isObjectRecord(reference)) continue;
|
|
944
|
+
const update = createTranscriptMediaReferenceUpdate(reference, meta);
|
|
945
|
+
if (update) yield emit(update);
|
|
946
|
+
}
|
|
947
|
+
}
|
|
948
|
+
*projectAssistantRecord(record, emit, meta) {
|
|
949
|
+
const usageMetadata = isObjectRecord(record.usageMetadata) ? record.usageMetadata : void 0;
|
|
950
|
+
let usageEmitted = false;
|
|
951
|
+
const takeUsageUpdate = /* @__PURE__ */ __name(() => {
|
|
952
|
+
if (!usageMetadata || usageEmitted) return void 0;
|
|
953
|
+
usageEmitted = true;
|
|
954
|
+
this.addUsage(usageMetadata);
|
|
955
|
+
return createTranscriptUsageUpdate(usageMetadata, meta);
|
|
956
|
+
}, "takeUsageUpdate");
|
|
957
|
+
yield* this.projectMessageParts(
|
|
958
|
+
record,
|
|
959
|
+
"assistant",
|
|
960
|
+
emit,
|
|
961
|
+
meta,
|
|
962
|
+
takeUsageUpdate
|
|
963
|
+
);
|
|
964
|
+
const trailingUsage = takeUsageUpdate();
|
|
965
|
+
if (trailingUsage) yield emit(trailingUsage);
|
|
966
|
+
}
|
|
967
|
+
*projectMessageParts(record, role, emit, meta, beforeToolCall, partsOverride) {
|
|
968
|
+
const parts = partsOverride ?? record.message?.parts;
|
|
969
|
+
if (!parts) return;
|
|
970
|
+
for (let partIndex = 0; partIndex < parts.length; partIndex += 1) {
|
|
971
|
+
const part = parts[partIndex];
|
|
972
|
+
if (!isObjectRecord(part)) {
|
|
973
|
+
this.report(
|
|
974
|
+
"malformed_part",
|
|
975
|
+
"Skipped a malformed transcript message part.",
|
|
976
|
+
record.uuid,
|
|
977
|
+
`message.parts[${partIndex}]`
|
|
978
|
+
);
|
|
979
|
+
continue;
|
|
980
|
+
}
|
|
981
|
+
let recognized = false;
|
|
982
|
+
if (typeof part["text"] === "string" && part["text"].length > 0) {
|
|
983
|
+
recognized = true;
|
|
984
|
+
yield emit(
|
|
985
|
+
createTranscriptMessageUpdate({
|
|
986
|
+
role,
|
|
987
|
+
text: part["text"],
|
|
988
|
+
thought: role === "assistant" && part["thought"] === true,
|
|
989
|
+
...meta
|
|
990
|
+
})
|
|
991
|
+
);
|
|
992
|
+
}
|
|
993
|
+
const inlineData = isObjectRecord(part["inlineData"]) ? part["inlineData"] : void 0;
|
|
994
|
+
if (inlineData) {
|
|
995
|
+
recognized = true;
|
|
996
|
+
const data = inlineData["data"];
|
|
997
|
+
const mimeType = inlineData["mimeType"];
|
|
998
|
+
if (role === "user" && typeof data === "string" && typeof mimeType === "string" && mimeType.startsWith("image/")) {
|
|
999
|
+
yield emit(createTranscriptImageUpdate({ data, mimeType, ...meta }));
|
|
1000
|
+
} else {
|
|
1001
|
+
this.report(
|
|
1002
|
+
"malformed_part",
|
|
1003
|
+
"Skipped an unsupported or malformed inline transcript part.",
|
|
1004
|
+
record.uuid,
|
|
1005
|
+
`message.parts[${partIndex}].inlineData`
|
|
1006
|
+
);
|
|
1007
|
+
}
|
|
1008
|
+
}
|
|
1009
|
+
const functionCall = isObjectRecord(part["functionCall"]) ? part["functionCall"] : void 0;
|
|
1010
|
+
if (functionCall) {
|
|
1011
|
+
recognized = true;
|
|
1012
|
+
const toolName = typeof functionCall["name"] === "string" ? functionCall["name"] : "";
|
|
1013
|
+
const args = isObjectRecord(functionCall["args"]) ? functionCall["args"] : {};
|
|
1014
|
+
if (!toolName) {
|
|
1015
|
+
this.report(
|
|
1016
|
+
"malformed_part",
|
|
1017
|
+
"Skipped a tool call without a tool name.",
|
|
1018
|
+
record.uuid,
|
|
1019
|
+
`message.parts[${partIndex}].functionCall`
|
|
1020
|
+
);
|
|
1021
|
+
continue;
|
|
1022
|
+
}
|
|
1023
|
+
const preToolUpdate = beforeToolCall?.();
|
|
1024
|
+
if (preToolUpdate) yield emit(preToolUpdate);
|
|
1025
|
+
if (toolName === "todo_write") continue;
|
|
1026
|
+
const explicitId = typeof functionCall["id"] === "string" && functionCall["id"].length > 0 ? functionCall["id"] : void 0;
|
|
1027
|
+
const callId = this.allocateToolCallId(
|
|
1028
|
+
explicitId ?? `qwen-replay-tool:${record.uuid}:${partIndex}`
|
|
1029
|
+
);
|
|
1030
|
+
const update = createTranscriptToolCallStartUpdate({
|
|
1031
|
+
toolName,
|
|
1032
|
+
callId,
|
|
1033
|
+
args,
|
|
1034
|
+
status: "in_progress",
|
|
1035
|
+
metadata: this.resolveToolMetadata(toolName, args, record.uuid),
|
|
1036
|
+
...meta
|
|
1037
|
+
});
|
|
1038
|
+
yield emit(update);
|
|
1039
|
+
if (role === "assistant") {
|
|
1040
|
+
this.pendingToolCalls.set(callId, {
|
|
1041
|
+
callId,
|
|
1042
|
+
toolName,
|
|
1043
|
+
sourceRecordId: record.uuid,
|
|
1044
|
+
...record.timestamp ? { sourceTimestamp: record.timestamp } : {}
|
|
1045
|
+
});
|
|
1046
|
+
}
|
|
1047
|
+
}
|
|
1048
|
+
if (!recognized && !("functionResponse" in part)) {
|
|
1049
|
+
this.report(
|
|
1050
|
+
"unknown_record_or_part",
|
|
1051
|
+
"Skipped an unknown transcript message part.",
|
|
1052
|
+
record.uuid,
|
|
1053
|
+
`message.parts[${partIndex}]`
|
|
1054
|
+
);
|
|
1055
|
+
}
|
|
1056
|
+
}
|
|
1057
|
+
}
|
|
1058
|
+
*projectToolResult(record, emit, meta) {
|
|
1059
|
+
const result = isObjectRecord(record.toolCallResult) ? record.toolCallResult : void 0;
|
|
1060
|
+
const toolName = extractToolName(record);
|
|
1061
|
+
if (!toolName) {
|
|
1062
|
+
this.report(
|
|
1063
|
+
"malformed_part",
|
|
1064
|
+
"A transcript tool result has no tool name.",
|
|
1065
|
+
record.uuid,
|
|
1066
|
+
"message.parts"
|
|
1067
|
+
);
|
|
1068
|
+
}
|
|
1069
|
+
const explicitCallId = extractToolResultCallId(record, result);
|
|
1070
|
+
const callId = explicitCallId ? this.allocateToolCallId(explicitCallId, true) : this.correlateResultCallId(toolName, record.uuid);
|
|
1071
|
+
this.pendingToolCalls.delete(callId);
|
|
1072
|
+
const resultDisplay = result?.["resultDisplay"];
|
|
1073
|
+
if (toolName === "todo_write") {
|
|
1074
|
+
const plan = extractTranscriptTodoPlan(resultDisplay);
|
|
1075
|
+
if (plan) {
|
|
1076
|
+
yield emit(
|
|
1077
|
+
createTranscriptPlanUpdate(plan.todos, this.usage, {
|
|
1078
|
+
...meta,
|
|
1079
|
+
planToolCallId: callId,
|
|
1080
|
+
todoPlanId: plan.planId
|
|
1081
|
+
})
|
|
1082
|
+
);
|
|
1083
|
+
}
|
|
1084
|
+
return;
|
|
1085
|
+
}
|
|
1086
|
+
yield emit(
|
|
1087
|
+
createTranscriptToolCallResultUpdate({
|
|
1088
|
+
toolName,
|
|
1089
|
+
callId,
|
|
1090
|
+
success: result?.["status"] === void 0 ? !result?.["error"] : result["status"] === "success" && !result["error"],
|
|
1091
|
+
errorMessage: extractErrorMessage(result?.["error"]),
|
|
1092
|
+
message: record.message?.parts,
|
|
1093
|
+
resultDisplay,
|
|
1094
|
+
artifacts: Array.isArray(result?.["artifacts"]) ? result["artifacts"] : void 0,
|
|
1095
|
+
contentPrefix: this.buildToolResultContentPrefix(
|
|
1096
|
+
resultDisplay,
|
|
1097
|
+
record.uuid
|
|
1098
|
+
),
|
|
1099
|
+
...meta
|
|
1100
|
+
})
|
|
1101
|
+
);
|
|
1102
|
+
if (isTaskExecutionDisplay(resultDisplay)) {
|
|
1103
|
+
const usage = usageFromTaskExecution(resultDisplay);
|
|
1104
|
+
if (Object.keys(usage).length > 0) {
|
|
1105
|
+
this.addUsage(usage);
|
|
1106
|
+
yield emit(createTranscriptUsageUpdate(usage, meta));
|
|
1107
|
+
}
|
|
1108
|
+
}
|
|
1109
|
+
}
|
|
1110
|
+
*projectSystemRecord(record, emit, meta) {
|
|
1111
|
+
if (record.subtype === "goal_state") {
|
|
1112
|
+
const payload2 = parseGoalStateRecordPayloadV2(record.systemPayload);
|
|
1113
|
+
if (!payload2) {
|
|
1114
|
+
this.report(
|
|
1115
|
+
"malformed_goal_state",
|
|
1116
|
+
"Skipped a malformed Goal state transcript record.",
|
|
1117
|
+
record.uuid,
|
|
1118
|
+
"systemPayload"
|
|
1119
|
+
);
|
|
1120
|
+
return;
|
|
1121
|
+
}
|
|
1122
|
+
const bookkeepingOnly = isGoalCheckpointBookkeepingRecord({
|
|
1123
|
+
cause: payload2.cause,
|
|
1124
|
+
previousCause: this.goalCause,
|
|
1125
|
+
previous: this.goalState,
|
|
1126
|
+
next: payload2.snapshot
|
|
1127
|
+
});
|
|
1128
|
+
const projection = projectGoalStateToLegacy2(
|
|
1129
|
+
payload2,
|
|
1130
|
+
this.goalState?.goal ?? null
|
|
1131
|
+
);
|
|
1132
|
+
this.goalState = payload2.snapshot;
|
|
1133
|
+
this.goalCause = payload2.cause;
|
|
1134
|
+
if (bookkeepingOnly) return;
|
|
1135
|
+
const { type: _type, ...goalStatus } = projection.goalStatus;
|
|
1136
|
+
yield emit(
|
|
1137
|
+
createTranscriptMessageUpdate({
|
|
1138
|
+
role: "assistant",
|
|
1139
|
+
text: "",
|
|
1140
|
+
...meta,
|
|
1141
|
+
extra: {
|
|
1142
|
+
goalState: payload2.snapshot,
|
|
1143
|
+
goalStatus,
|
|
1144
|
+
...projection.goalTerminal ? { goalTerminal: projection.goalTerminal } : {},
|
|
1145
|
+
"qwen.session.recordId": record.uuid
|
|
1146
|
+
}
|
|
1147
|
+
})
|
|
1148
|
+
);
|
|
1149
|
+
return;
|
|
1150
|
+
}
|
|
1151
|
+
if (record.subtype !== "slash_command") return;
|
|
1152
|
+
const payload = isObjectRecord(record.systemPayload) ? record.systemPayload : void 0;
|
|
1153
|
+
if (payload?.["phase"] !== "result") return;
|
|
1154
|
+
const items = Array.isArray(payload["outputHistoryItems"]) ? payload["outputHistoryItems"] : [];
|
|
1155
|
+
for (const item of items) {
|
|
1156
|
+
const goalStatus = parseTranscriptGoalStatus(item);
|
|
1157
|
+
if (goalStatus) {
|
|
1158
|
+
if (goalStatus.condition.length === 0) {
|
|
1159
|
+
this.report(
|
|
1160
|
+
"malformed_part",
|
|
1161
|
+
"Skipped replay of a goal card whose condition is empty.",
|
|
1162
|
+
record.uuid,
|
|
1163
|
+
"systemPayload.outputHistoryItems.goalStatus.condition"
|
|
1164
|
+
);
|
|
1165
|
+
} else if (goalStatus.kind !== "checking") {
|
|
1166
|
+
yield emit(
|
|
1167
|
+
createTranscriptMessageUpdate({
|
|
1168
|
+
role: "assistant",
|
|
1169
|
+
text: "",
|
|
1170
|
+
...meta,
|
|
1171
|
+
extra: { goalStatus }
|
|
1172
|
+
})
|
|
1173
|
+
);
|
|
1174
|
+
}
|
|
1175
|
+
continue;
|
|
1176
|
+
}
|
|
1177
|
+
if (!isObjectRecord(item) || typeof item["text"] !== "string") continue;
|
|
1178
|
+
yield emit(
|
|
1179
|
+
createTranscriptMessageUpdate({
|
|
1180
|
+
role: "assistant",
|
|
1181
|
+
text: item["text"].replace(/\n/g, " \n"),
|
|
1182
|
+
...meta,
|
|
1183
|
+
extra: { source: "slash_command" }
|
|
1184
|
+
})
|
|
1185
|
+
);
|
|
1186
|
+
}
|
|
1187
|
+
}
|
|
1188
|
+
addUsage(metadata) {
|
|
1189
|
+
this.usage.promptTokens += finiteNumber(metadata["promptTokenCount"]) ?? 0;
|
|
1190
|
+
this.usage.candidateTokens += finiteNumber(metadata["candidatesTokenCount"]) ?? 0;
|
|
1191
|
+
this.usage.cachedTokens += finiteNumber(metadata["cachedContentTokenCount"]) ?? 0;
|
|
1192
|
+
}
|
|
1193
|
+
correlateResultCallId(toolName, recordId) {
|
|
1194
|
+
const candidates = [...this.pendingToolCalls.values()].filter(
|
|
1195
|
+
(pending) => pending.toolName === toolName
|
|
1196
|
+
);
|
|
1197
|
+
if (candidates.length === 1) return candidates[0].callId;
|
|
1198
|
+
this.report(
|
|
1199
|
+
"ambiguous_tool_call_correlation",
|
|
1200
|
+
"A tool result could not be matched to exactly one pending tool call.",
|
|
1201
|
+
recordId
|
|
1202
|
+
);
|
|
1203
|
+
return this.allocateToolCallId(`qwen-replay-tool:${recordId}:result`);
|
|
1204
|
+
}
|
|
1205
|
+
allocateToolCallId(candidate, reuse = false) {
|
|
1206
|
+
if (reuse && this.pendingToolCalls.has(candidate)) {
|
|
1207
|
+
this.usedToolCallIds.add(candidate);
|
|
1208
|
+
return candidate;
|
|
1209
|
+
}
|
|
1210
|
+
if (!this.usedToolCallIds.has(candidate)) {
|
|
1211
|
+
this.usedToolCallIds.add(candidate);
|
|
1212
|
+
return candidate;
|
|
1213
|
+
}
|
|
1214
|
+
let occurrence = 2;
|
|
1215
|
+
while (this.usedToolCallIds.has(`${candidate}:${occurrence}`)) {
|
|
1216
|
+
occurrence += 1;
|
|
1217
|
+
}
|
|
1218
|
+
const id = `${candidate}:${occurrence}`;
|
|
1219
|
+
this.usedToolCallIds.add(id);
|
|
1220
|
+
return id;
|
|
1221
|
+
}
|
|
1222
|
+
resolveToolMetadata(toolName, args, recordId) {
|
|
1223
|
+
try {
|
|
1224
|
+
return this.options.presentation?.resolveToolMetadata(toolName, args) ?? fallbackToolMetadata(toolName, args);
|
|
1225
|
+
} catch {
|
|
1226
|
+
this.report(
|
|
1227
|
+
"presentation_fallback",
|
|
1228
|
+
"Tool presentation metadata fell back to deterministic defaults.",
|
|
1229
|
+
recordId,
|
|
1230
|
+
void 0,
|
|
1231
|
+
false
|
|
1232
|
+
);
|
|
1233
|
+
return fallbackToolMetadata(toolName, args);
|
|
1234
|
+
}
|
|
1235
|
+
}
|
|
1236
|
+
formatGap(gap) {
|
|
1237
|
+
try {
|
|
1238
|
+
return this.options.presentation?.formatHistoryGap(gap) ?? "Some earlier messages are unavailable because the saved history is incomplete.";
|
|
1239
|
+
} catch {
|
|
1240
|
+
this.report(
|
|
1241
|
+
"presentation_fallback",
|
|
1242
|
+
"History gap presentation fell back to deterministic defaults.",
|
|
1243
|
+
gap.childUuid,
|
|
1244
|
+
void 0,
|
|
1245
|
+
false
|
|
1246
|
+
);
|
|
1247
|
+
return "Some earlier messages are unavailable because the saved history is incomplete.";
|
|
1248
|
+
}
|
|
1249
|
+
}
|
|
1250
|
+
buildToolResultContentPrefix(resultDisplay, recordId) {
|
|
1251
|
+
try {
|
|
1252
|
+
return this.options.presentation?.buildToolResultContentPrefix?.(
|
|
1253
|
+
resultDisplay
|
|
1254
|
+
) ?? defaultToolResultContentPrefix(resultDisplay);
|
|
1255
|
+
} catch {
|
|
1256
|
+
this.report(
|
|
1257
|
+
"presentation_fallback",
|
|
1258
|
+
"Tool result content presentation fell back to deterministic defaults.",
|
|
1259
|
+
recordId,
|
|
1260
|
+
void 0,
|
|
1261
|
+
false
|
|
1262
|
+
);
|
|
1263
|
+
return defaultToolResultContentPrefix(resultDisplay);
|
|
1264
|
+
}
|
|
1265
|
+
}
|
|
1266
|
+
report(code, message, recordId, path2, affectsCompleteness = true) {
|
|
1267
|
+
this.options.onDiagnostic?.({
|
|
1268
|
+
code,
|
|
1269
|
+
severity: affectsCompleteness ? "warning" : "info",
|
|
1270
|
+
message,
|
|
1271
|
+
affectsCompleteness,
|
|
1272
|
+
...recordId ? { recordId } : {},
|
|
1273
|
+
...path2 ? { path: path2 } : {}
|
|
1274
|
+
});
|
|
1275
|
+
}
|
|
1276
|
+
};
|
|
1277
|
+
function parseTranscriptGoalStatus(value) {
|
|
1278
|
+
if (!isObjectRecord(value) || value["type"] !== "goal_status") {
|
|
1279
|
+
return void 0;
|
|
1280
|
+
}
|
|
1281
|
+
const kind = value["kind"];
|
|
1282
|
+
const condition = value["condition"];
|
|
1283
|
+
if (typeof kind !== "string" || !TRANSCRIPT_GOAL_STATUS_KINDS.has(kind) || typeof condition !== "string") {
|
|
1284
|
+
return void 0;
|
|
1285
|
+
}
|
|
1286
|
+
const iterations = finiteNumber(value["iterations"]);
|
|
1287
|
+
const setAt = finiteNumber(value["setAt"]);
|
|
1288
|
+
const durationMs = finiteNumber(value["durationMs"]);
|
|
1289
|
+
const lastReason = typeof value["lastReason"] === "string" ? value["lastReason"] : void 0;
|
|
1290
|
+
return {
|
|
1291
|
+
kind,
|
|
1292
|
+
condition,
|
|
1293
|
+
...iterations !== void 0 ? { iterations } : {},
|
|
1294
|
+
...setAt !== void 0 ? { setAt } : {},
|
|
1295
|
+
...durationMs !== void 0 ? { durationMs } : {},
|
|
1296
|
+
...lastReason !== void 0 ? { lastReason } : {}
|
|
1297
|
+
};
|
|
1298
|
+
}
|
|
1299
|
+
__name(parseTranscriptGoalStatus, "parseTranscriptGoalStatus");
|
|
1300
|
+
function defaultToolResultContentPrefix(resultDisplay) {
|
|
1301
|
+
if (!isObjectRecord(resultDisplay) || resultDisplay["type"] !== "vision_bridge_notice" || typeof resultDisplay["summary"] !== "string" || typeof resultDisplay["notice"] !== "string") {
|
|
1302
|
+
return [];
|
|
1303
|
+
}
|
|
1304
|
+
return [
|
|
1305
|
+
{
|
|
1306
|
+
type: "content",
|
|
1307
|
+
content: {
|
|
1308
|
+
type: "text",
|
|
1309
|
+
text: `${resultDisplay["summary"]}
|
|
1310
|
+
${resultDisplay["notice"]}`
|
|
1311
|
+
}
|
|
1312
|
+
}
|
|
1313
|
+
];
|
|
1314
|
+
}
|
|
1315
|
+
__name(defaultToolResultContentPrefix, "defaultToolResultContentPrefix");
|
|
1316
|
+
function parseInitialState(value, onDiagnostic) {
|
|
1317
|
+
const empty = {
|
|
1318
|
+
v: 1,
|
|
1319
|
+
pendingToolCalls: [],
|
|
1320
|
+
cumulativeUsage: emptyUsage()
|
|
1321
|
+
};
|
|
1322
|
+
if (value === void 0) return empty;
|
|
1323
|
+
if (!isObjectRecord(value)) {
|
|
1324
|
+
throw new TypeError("Invalid transcript replay state.");
|
|
1325
|
+
}
|
|
1326
|
+
if ("v" in value && value["v"] !== 1) {
|
|
1327
|
+
throw new TypeError("Unsupported transcript replay state version.");
|
|
1328
|
+
}
|
|
1329
|
+
const rawPending = Array.isArray(value["pendingToolCalls"]) ? value["pendingToolCalls"] : [];
|
|
1330
|
+
const pendingToolCalls = rawPending.flatMap(
|
|
1331
|
+
(pending) => {
|
|
1332
|
+
if (!isObjectRecord(pending) || typeof pending["callId"] !== "string" || typeof pending["toolName"] !== "string" || typeof pending["sourceRecordId"] !== "string") {
|
|
1333
|
+
onDiagnostic?.({
|
|
1334
|
+
code: "invalid_replay_state",
|
|
1335
|
+
severity: "warning",
|
|
1336
|
+
message: "Dropped a malformed pending tool call from replay state.",
|
|
1337
|
+
affectsCompleteness: true
|
|
1338
|
+
});
|
|
1339
|
+
return [];
|
|
1340
|
+
}
|
|
1341
|
+
return [
|
|
1342
|
+
{
|
|
1343
|
+
callId: pending["callId"],
|
|
1344
|
+
toolName: pending["toolName"],
|
|
1345
|
+
sourceRecordId: pending["sourceRecordId"],
|
|
1346
|
+
...typeof pending["sourceTimestamp"] === "string" ? { sourceTimestamp: pending["sourceTimestamp"] } : {}
|
|
1347
|
+
}
|
|
1348
|
+
];
|
|
1349
|
+
}
|
|
1350
|
+
);
|
|
1351
|
+
const rawUsage = value.cumulativeUsage;
|
|
1352
|
+
const usage = isObjectRecord(rawUsage) ? rawUsage : {};
|
|
1353
|
+
const validUsage = finiteNumber(usage["promptTokens"]) !== void 0 && finiteNumber(usage["cachedTokens"]) !== void 0 && finiteNumber(usage["candidateTokens"]) !== void 0 && finiteNumber(usage["apiTimeMs"]) !== void 0;
|
|
1354
|
+
if (!validUsage) {
|
|
1355
|
+
onDiagnostic?.({
|
|
1356
|
+
code: "invalid_replay_state",
|
|
1357
|
+
severity: "warning",
|
|
1358
|
+
message: "Reset invalid cumulative usage in transcript replay state.",
|
|
1359
|
+
affectsCompleteness: true
|
|
1360
|
+
});
|
|
1361
|
+
}
|
|
1362
|
+
const rawGoalState = value["goalState"];
|
|
1363
|
+
const goalState = rawGoalState === void 0 ? void 0 : parseGoalSnapshotV22(rawGoalState);
|
|
1364
|
+
if (rawGoalState !== void 0 && !goalState) {
|
|
1365
|
+
onDiagnostic?.({
|
|
1366
|
+
code: "invalid_replay_state",
|
|
1367
|
+
severity: "warning",
|
|
1368
|
+
message: "Dropped a malformed Goal state from replay state.",
|
|
1369
|
+
affectsCompleteness: true
|
|
1370
|
+
});
|
|
1371
|
+
}
|
|
1372
|
+
const rawGoalCause = value["goalCause"];
|
|
1373
|
+
const goalCause = rawGoalCause === void 0 ? void 0 : parseGoalStateCause2(rawGoalCause);
|
|
1374
|
+
if (rawGoalCause !== void 0 && !goalCause) {
|
|
1375
|
+
onDiagnostic?.({
|
|
1376
|
+
code: "invalid_replay_state",
|
|
1377
|
+
severity: "warning",
|
|
1378
|
+
message: "Dropped a malformed Goal cause from replay state.",
|
|
1379
|
+
affectsCompleteness: true
|
|
1380
|
+
});
|
|
1381
|
+
}
|
|
1382
|
+
return {
|
|
1383
|
+
v: 1,
|
|
1384
|
+
pendingToolCalls,
|
|
1385
|
+
cumulativeUsage: validUsage ? {
|
|
1386
|
+
promptTokens: usage["promptTokens"],
|
|
1387
|
+
cachedTokens: usage["cachedTokens"],
|
|
1388
|
+
candidateTokens: usage["candidateTokens"],
|
|
1389
|
+
apiTimeMs: usage["apiTimeMs"]
|
|
1390
|
+
} : emptyUsage(),
|
|
1391
|
+
...goalState ? { goalState } : {},
|
|
1392
|
+
...goalCause ? { goalCause } : {}
|
|
1393
|
+
};
|
|
1394
|
+
}
|
|
1395
|
+
__name(parseInitialState, "parseInitialState");
|
|
1396
|
+
function emptyUsage() {
|
|
1397
|
+
return {
|
|
1398
|
+
promptTokens: 0,
|
|
1399
|
+
cachedTokens: 0,
|
|
1400
|
+
candidateTokens: 0,
|
|
1401
|
+
apiTimeMs: 0
|
|
1402
|
+
};
|
|
1403
|
+
}
|
|
1404
|
+
__name(emptyUsage, "emptyUsage");
|
|
1405
|
+
function fallbackToolMetadata(toolName, args) {
|
|
1406
|
+
const description = typeof args["description"] === "string" ? args["description"].trim() : "";
|
|
1407
|
+
return {
|
|
1408
|
+
title: description ? `${toolName}: ${description}` : toolName,
|
|
1409
|
+
locations: [],
|
|
1410
|
+
kind: "other"
|
|
1411
|
+
};
|
|
1412
|
+
}
|
|
1413
|
+
__name(fallbackToolMetadata, "fallbackToolMetadata");
|
|
1414
|
+
function resolveToolProvenance(toolName) {
|
|
1415
|
+
if (toolName.startsWith("mcp__")) {
|
|
1416
|
+
const parts = toolName.split("__");
|
|
1417
|
+
if (parts.length >= 3 && parts[1]) {
|
|
1418
|
+
return { provenance: "mcp", serverId: parts[1] };
|
|
1419
|
+
}
|
|
1420
|
+
}
|
|
1421
|
+
return { provenance: "builtin" };
|
|
1422
|
+
}
|
|
1423
|
+
__name(resolveToolProvenance, "resolveToolProvenance");
|
|
1424
|
+
function buildToolResultContent(options) {
|
|
1425
|
+
const prefix = [...options.contentPrefix ?? []];
|
|
1426
|
+
const diff = extractDiffContent(options.resultDisplay);
|
|
1427
|
+
if (diff) return [...prefix, diff];
|
|
1428
|
+
if (options.errorMessage) {
|
|
1429
|
+
return [
|
|
1430
|
+
...prefix,
|
|
1431
|
+
{
|
|
1432
|
+
type: "content",
|
|
1433
|
+
content: { type: "text", text: options.errorMessage }
|
|
1434
|
+
}
|
|
1435
|
+
];
|
|
1436
|
+
}
|
|
1437
|
+
const content = [...prefix];
|
|
1438
|
+
for (const part of options.message ?? []) {
|
|
1439
|
+
if (!isObjectRecord(part)) continue;
|
|
1440
|
+
if (typeof part["text"] === "string" && part["text"]) {
|
|
1441
|
+
content.push({
|
|
1442
|
+
type: "content",
|
|
1443
|
+
content: { type: "text", text: part["text"] }
|
|
1444
|
+
});
|
|
1445
|
+
}
|
|
1446
|
+
const response = isObjectRecord(part["functionResponse"]) ? part["functionResponse"] : void 0;
|
|
1447
|
+
const payload = response && isObjectRecord(response["response"]) ? response["response"] : void 0;
|
|
1448
|
+
if (!payload) continue;
|
|
1449
|
+
try {
|
|
1450
|
+
const output = payload["output"];
|
|
1451
|
+
const error = payload["error"];
|
|
1452
|
+
const text = typeof output === "string" ? output : typeof error === "string" ? error : JSON.stringify(payload);
|
|
1453
|
+
content.push({
|
|
1454
|
+
type: "content",
|
|
1455
|
+
content: { type: "text", text }
|
|
1456
|
+
});
|
|
1457
|
+
} catch {
|
|
1458
|
+
}
|
|
1459
|
+
}
|
|
1460
|
+
return content;
|
|
1461
|
+
}
|
|
1462
|
+
__name(buildToolResultContent, "buildToolResultContent");
|
|
1463
|
+
function extractDiffContent(resultDisplay) {
|
|
1464
|
+
if (!isObjectRecord(resultDisplay)) return null;
|
|
1465
|
+
if (!("fileName" in resultDisplay) || !("newContent" in resultDisplay)) {
|
|
1466
|
+
return null;
|
|
1467
|
+
}
|
|
1468
|
+
if (isTruncatedSessionDiffDisplay(resultDisplay)) {
|
|
1469
|
+
return {
|
|
1470
|
+
type: "content",
|
|
1471
|
+
content: {
|
|
1472
|
+
type: "text",
|
|
1473
|
+
text: buildTruncatedDiffPreviewText(resultDisplay)
|
|
1474
|
+
}
|
|
1475
|
+
};
|
|
1476
|
+
}
|
|
1477
|
+
return {
|
|
1478
|
+
type: "diff",
|
|
1479
|
+
path: typeof resultDisplay["fileName"] === "string" ? resultDisplay["fileName"] : "",
|
|
1480
|
+
oldText: typeof resultDisplay["originalContent"] === "string" ? resultDisplay["originalContent"] : "",
|
|
1481
|
+
newText: typeof resultDisplay["newContent"] === "string" ? resultDisplay["newContent"] : ""
|
|
1482
|
+
};
|
|
1483
|
+
}
|
|
1484
|
+
__name(extractDiffContent, "extractDiffContent");
|
|
1485
|
+
function isTruncatedSessionDiffDisplay(value) {
|
|
1486
|
+
return isObjectRecord(value) && value["truncatedForSession"] === true && "fileName" in value && "newContent" in value;
|
|
1487
|
+
}
|
|
1488
|
+
__name(isTruncatedSessionDiffDisplay, "isTruncatedSessionDiffDisplay");
|
|
1489
|
+
function buildTruncatedDiffPreviewText(display) {
|
|
1490
|
+
const fileName = typeof display["fileName"] === "string" ? display["fileName"] : "the edited file";
|
|
1491
|
+
const fileDiffLength = typeof display["fileDiffLength"] === "number" ? ` Original fileDiff length: ${display["fileDiffLength"]} chars.` : "";
|
|
1492
|
+
return display["fileDiffTruncated"] === true ? `Full diff omitted from saved session history for ${fileName}.${fileDiffLength}` : `Saved session preview only for ${fileName}; full original and new file contents are unavailable.`;
|
|
1493
|
+
}
|
|
1494
|
+
__name(buildTruncatedDiffPreviewText, "buildTruncatedDiffPreviewText");
|
|
1495
|
+
function extractToolName(record) {
|
|
1496
|
+
for (const part of record.message?.parts ?? []) {
|
|
1497
|
+
if (!isObjectRecord(part) || !isObjectRecord(part["functionResponse"])) {
|
|
1498
|
+
continue;
|
|
1499
|
+
}
|
|
1500
|
+
const name = part["functionResponse"]["name"];
|
|
1501
|
+
if (typeof name === "string") return name;
|
|
1502
|
+
}
|
|
1503
|
+
return "";
|
|
1504
|
+
}
|
|
1505
|
+
__name(extractToolName, "extractToolName");
|
|
1506
|
+
function extractToolResultCallId(record, result) {
|
|
1507
|
+
if (typeof result?.["callId"] === "string" && result["callId"].length > 0) {
|
|
1508
|
+
return result["callId"];
|
|
1509
|
+
}
|
|
1510
|
+
for (const part of record.message?.parts ?? []) {
|
|
1511
|
+
if (!isObjectRecord(part) || !isObjectRecord(part["functionResponse"])) {
|
|
1512
|
+
continue;
|
|
1513
|
+
}
|
|
1514
|
+
const id = part["functionResponse"]["id"];
|
|
1515
|
+
if (typeof id === "string" && id.length > 0) return id;
|
|
1516
|
+
}
|
|
1517
|
+
return void 0;
|
|
1518
|
+
}
|
|
1519
|
+
__name(extractToolResultCallId, "extractToolResultCallId");
|
|
1520
|
+
function extractTodoPlanFromDisplay(value) {
|
|
1521
|
+
if (isObjectRecord(value) && value["type"] === "todo_list") {
|
|
1522
|
+
return Array.isArray(value["todos"]) ? {
|
|
1523
|
+
...typeof value["planId"] === "string" ? { planId: value["planId"] } : {},
|
|
1524
|
+
todos: normalizeTodos(value["todos"])
|
|
1525
|
+
} : null;
|
|
1526
|
+
}
|
|
1527
|
+
if (typeof value !== "string") return null;
|
|
1528
|
+
try {
|
|
1529
|
+
const parsed = JSON.parse(value);
|
|
1530
|
+
return isObjectRecord(parsed) && parsed["type"] === "todo_list" && Array.isArray(parsed["todos"]) ? {
|
|
1531
|
+
...typeof parsed["planId"] === "string" ? { planId: parsed["planId"] } : {},
|
|
1532
|
+
todos: normalizeTodos(parsed["todos"])
|
|
1533
|
+
} : null;
|
|
1534
|
+
} catch {
|
|
1535
|
+
return null;
|
|
1536
|
+
}
|
|
1537
|
+
}
|
|
1538
|
+
__name(extractTodoPlanFromDisplay, "extractTodoPlanFromDisplay");
|
|
1539
|
+
function normalizeTodos(values) {
|
|
1540
|
+
return values.flatMap((value) => {
|
|
1541
|
+
if (!isObjectRecord(value) || typeof value["content"] !== "string")
|
|
1542
|
+
return [];
|
|
1543
|
+
const status = value["status"];
|
|
1544
|
+
if (status !== "pending" && status !== "in_progress" && status !== "completed") {
|
|
1545
|
+
return [];
|
|
1546
|
+
}
|
|
1547
|
+
return [
|
|
1548
|
+
{
|
|
1549
|
+
...typeof value["id"] === "string" ? { id: value["id"] } : {},
|
|
1550
|
+
content: value["content"],
|
|
1551
|
+
status,
|
|
1552
|
+
...Array.isArray(value["blockedBy"]) && value["blockedBy"].every((dependency) => typeof dependency === "string") ? { blockedBy: value["blockedBy"] } : {}
|
|
1553
|
+
}
|
|
1554
|
+
];
|
|
1555
|
+
});
|
|
1556
|
+
}
|
|
1557
|
+
__name(normalizeTodos, "normalizeTodos");
|
|
1558
|
+
function isTaskExecutionDisplay(value) {
|
|
1559
|
+
return isObjectRecord(value) && value["type"] === "task_execution";
|
|
1560
|
+
}
|
|
1561
|
+
__name(isTaskExecutionDisplay, "isTaskExecutionDisplay");
|
|
1562
|
+
function usageFromTaskExecution(display) {
|
|
1563
|
+
const summary = isObjectRecord(display["executionSummary"]) ? display["executionSummary"] : void 0;
|
|
1564
|
+
if (!summary) return {};
|
|
1565
|
+
return {
|
|
1566
|
+
...finiteNumber(summary["inputTokens"]) !== void 0 ? { promptTokenCount: summary["inputTokens"] } : {},
|
|
1567
|
+
...finiteNumber(summary["outputTokens"]) !== void 0 ? { candidatesTokenCount: summary["outputTokens"] } : {},
|
|
1568
|
+
...finiteNumber(summary["thoughtTokens"]) !== void 0 ? { thoughtsTokenCount: summary["thoughtTokens"] } : {},
|
|
1569
|
+
...finiteNumber(summary["cachedTokens"]) !== void 0 ? { cachedContentTokenCount: summary["cachedTokens"] } : {},
|
|
1570
|
+
...finiteNumber(summary["totalTokens"]) !== void 0 ? { totalTokenCount: summary["totalTokens"] } : {}
|
|
1571
|
+
};
|
|
1572
|
+
}
|
|
1573
|
+
__name(usageFromTaskExecution, "usageFromTaskExecution");
|
|
1574
|
+
function finiteNumber(value) {
|
|
1575
|
+
return typeof value === "number" && Number.isFinite(value) ? value : void 0;
|
|
1576
|
+
}
|
|
1577
|
+
__name(finiteNumber, "finiteNumber");
|
|
1578
|
+
function extractErrorMessage(value) {
|
|
1579
|
+
if (value instanceof Error) return value.message;
|
|
1580
|
+
if (!isObjectRecord(value)) return void 0;
|
|
1581
|
+
return typeof value["message"] === "string" ? value["message"] : void 0;
|
|
1582
|
+
}
|
|
1583
|
+
__name(extractErrorMessage, "extractErrorMessage");
|
|
1584
|
+
function dedupeStrings(values) {
|
|
1585
|
+
return [...new Set(values.filter((value) => value.length > 0))];
|
|
1586
|
+
}
|
|
1587
|
+
__name(dedupeStrings, "dedupeStrings");
|
|
1588
|
+
|
|
1589
|
+
// packages/cli/src/acp-integration/session/emitters/tool-call-emitter.ts
|
|
1590
|
+
init_esbuild_shims();
|
|
1591
|
+
|
|
1592
|
+
// packages/cli/src/acp-integration/session/emitters/base-emitter.ts
|
|
1593
|
+
init_esbuild_shims();
|
|
1594
|
+
var BaseEmitter = class {
|
|
1595
|
+
constructor(ctx) {
|
|
1596
|
+
this.ctx = ctx;
|
|
1597
|
+
}
|
|
1598
|
+
static {
|
|
1599
|
+
__name(this, "BaseEmitter");
|
|
1600
|
+
}
|
|
1601
|
+
/**
|
|
1602
|
+
* Converts an ISO timestamp string or epoch ms to epoch ms number.
|
|
1603
|
+
* Returns undefined if the input is not a valid timestamp.
|
|
1604
|
+
*/
|
|
1605
|
+
static toEpochMs(ts) {
|
|
1606
|
+
if (typeof ts === "number") {
|
|
1607
|
+
return Number.isFinite(ts) ? ts : void 0;
|
|
1608
|
+
}
|
|
1609
|
+
if (typeof ts === "string") {
|
|
1610
|
+
const ms = new Date(ts).getTime();
|
|
1611
|
+
return Number.isFinite(ms) ? ms : void 0;
|
|
1612
|
+
}
|
|
1613
|
+
return void 0;
|
|
1614
|
+
}
|
|
1615
|
+
/**
|
|
1616
|
+
* Sends a session update to the ACP client.
|
|
1617
|
+
* If a message rewriter is configured, updates pass through it first
|
|
1618
|
+
* (original messages are sent as-is, rewritten versions are appended).
|
|
1619
|
+
*/
|
|
1620
|
+
async sendUpdate(update) {
|
|
1621
|
+
if (this.ctx.messageRewriter) {
|
|
1622
|
+
return this.ctx.messageRewriter.interceptUpdate(update);
|
|
1623
|
+
}
|
|
1624
|
+
return this.ctx.sendUpdate(update);
|
|
1625
|
+
}
|
|
1626
|
+
/**
|
|
1627
|
+
* Gets the session ID.
|
|
1628
|
+
*/
|
|
1629
|
+
get sessionId() {
|
|
1630
|
+
return this.ctx.sessionId;
|
|
1631
|
+
}
|
|
1632
|
+
};
|
|
1633
|
+
|
|
1634
|
+
// packages/cli/src/acp-integration/session/emitters/PlanEmitter.ts
|
|
1635
|
+
init_esbuild_shims();
|
|
1636
|
+
var PlanEmitter = class extends BaseEmitter {
|
|
1637
|
+
static {
|
|
1638
|
+
__name(this, "PlanEmitter");
|
|
1639
|
+
}
|
|
1640
|
+
/**
|
|
1641
|
+
* Emits a plan update with the given todo items.
|
|
1642
|
+
*
|
|
1643
|
+
* @param plan - Plan identity and todo items to send as plan entries
|
|
1644
|
+
*/
|
|
1645
|
+
async emitPlan(plan, sourceCallId) {
|
|
1646
|
+
const cumulative = this.ctx.cumulativeUsage;
|
|
1647
|
+
await this.sendUpdate(
|
|
1648
|
+
createTranscriptPlanUpdate(plan.todos, cumulative, {
|
|
1649
|
+
planToolCallId: sourceCallId,
|
|
1650
|
+
todoPlanId: plan.planId
|
|
1651
|
+
})
|
|
1652
|
+
);
|
|
1653
|
+
}
|
|
1654
|
+
/**
|
|
1655
|
+
* Extracts todos from tool result display or args.
|
|
1656
|
+
* Tries multiple sources in priority order:
|
|
1657
|
+
* 1. Result display object with type 'todo_list'
|
|
1658
|
+
* 2. Result display as JSON string
|
|
1659
|
+
* 3. Args with 'todos' array when no result display is available
|
|
1660
|
+
*
|
|
1661
|
+
* @param resultDisplay - The tool result display (object, string, or undefined)
|
|
1662
|
+
* @param args - The tool call arguments (fallback source)
|
|
1663
|
+
* @returns Plan snapshot if found, null otherwise
|
|
1664
|
+
*/
|
|
1665
|
+
extractPlan(resultDisplay, args) {
|
|
1666
|
+
const plan = extractTranscriptTodoPlan(resultDisplay, args);
|
|
1667
|
+
if (!plan) return null;
|
|
1668
|
+
return {
|
|
1669
|
+
...plan.planId ? { planId: plan.planId } : {},
|
|
1670
|
+
todos: plan.todos.map((todo, index) => ({
|
|
1671
|
+
id: todo.id ?? String(index),
|
|
1672
|
+
content: todo.content,
|
|
1673
|
+
status: todo.status,
|
|
1674
|
+
...todo.blockedBy ? { blockedBy: [...todo.blockedBy] } : {}
|
|
1675
|
+
}))
|
|
1676
|
+
};
|
|
1677
|
+
}
|
|
1678
|
+
};
|
|
1679
|
+
|
|
1680
|
+
// packages/cli/src/acp-integration/session/types.ts
|
|
1681
|
+
init_esbuild_shims();
|
|
1682
|
+
function hasFullSessionContext(context) {
|
|
1683
|
+
return "config" in context;
|
|
1684
|
+
}
|
|
1685
|
+
__name(hasFullSessionContext, "hasFullSessionContext");
|
|
1686
|
+
|
|
1687
|
+
// packages/cli/src/acp-integration/session/emitters/tool-call-emitter.ts
|
|
1688
|
+
var KIND_MAP = {
|
|
1689
|
+
["read" /* Read */]: "read",
|
|
1690
|
+
["edit" /* Edit */]: "edit",
|
|
1691
|
+
["delete" /* Delete */]: "delete",
|
|
1692
|
+
["move" /* Move */]: "move",
|
|
1693
|
+
["search" /* Search */]: "search",
|
|
1694
|
+
["execute" /* Execute */]: "execute",
|
|
1695
|
+
["think" /* Think */]: "think",
|
|
1696
|
+
["fetch" /* Fetch */]: "fetch",
|
|
1697
|
+
// ACP defines no 'agent' ToolKind (verified through @agentclientprotocol/sdk
|
|
1698
|
+
// 0.25.1). The daemon's ClientSideConnection Zod-validates every session/update
|
|
1699
|
+
// and session/request_permission from the `qwen --acp` child before fanning out
|
|
1700
|
+
// to SSE clients, so emitting 'agent' is rejected at that hop and the frame is
|
|
1701
|
+
// dropped. Map the internal Kind.Agent to 'other' on the wire to stay
|
|
1702
|
+
// protocol-valid; dedicated agent UI is delivered out-of-band (via _meta.toolName)
|
|
1703
|
+
// in a follow-up rather than via a kind the protocol can't carry.
|
|
1704
|
+
["agent" /* Agent */]: "other",
|
|
1705
|
+
["other" /* Other */]: "other"
|
|
1706
|
+
};
|
|
1707
|
+
function stripBoundaryArtifactsFromRawOutput(resultDisplay) {
|
|
1708
|
+
if (typeof resultDisplay !== "object" || resultDisplay === null || !("type" in resultDisplay) || resultDisplay.type !== "task_execution" || !("toolCalls" in resultDisplay) || !Array.isArray(resultDisplay.toolCalls)) {
|
|
1709
|
+
return resultDisplay;
|
|
1710
|
+
}
|
|
1711
|
+
let changed = false;
|
|
1712
|
+
const toolCalls = resultDisplay.toolCalls.map((toolCall) => {
|
|
1713
|
+
if (typeof toolCall !== "object" || toolCall === null || !("boundaryArtifact" in toolCall)) {
|
|
1714
|
+
return toolCall;
|
|
1715
|
+
}
|
|
1716
|
+
const rawOutputToolCall = { ...toolCall };
|
|
1717
|
+
delete rawOutputToolCall["boundaryArtifact"];
|
|
1718
|
+
changed = true;
|
|
1719
|
+
return rawOutputToolCall;
|
|
1720
|
+
});
|
|
1721
|
+
return changed ? { ...resultDisplay, toolCalls } : resultDisplay;
|
|
1722
|
+
}
|
|
1723
|
+
__name(stripBoundaryArtifactsFromRawOutput, "stripBoundaryArtifactsFromRawOutput");
|
|
1724
|
+
var ToolCallEmitter = class _ToolCallEmitter extends BaseEmitter {
|
|
1725
|
+
static {
|
|
1726
|
+
__name(this, "ToolCallEmitter");
|
|
1727
|
+
}
|
|
1728
|
+
planEmitter;
|
|
1729
|
+
preparedCallIds = /* @__PURE__ */ new Set();
|
|
1730
|
+
constructor(ctx) {
|
|
1731
|
+
super(ctx);
|
|
1732
|
+
this.planEmitter = new PlanEmitter(ctx);
|
|
1733
|
+
}
|
|
1734
|
+
/**
|
|
1735
|
+
* Emits a tool call start event.
|
|
1736
|
+
*
|
|
1737
|
+
* @param params - Tool call start parameters
|
|
1738
|
+
* @returns true if event was emitted, false if skipped (e.g., TodoWriteTool)
|
|
1739
|
+
*/
|
|
1740
|
+
async emitStart(params) {
|
|
1741
|
+
if (this.isTodoWriteTool(params.toolName)) {
|
|
1742
|
+
return false;
|
|
1743
|
+
}
|
|
1744
|
+
if (params.phase === "preparing" && this.preparedCallIds.has(params.callId)) {
|
|
1745
|
+
return false;
|
|
1746
|
+
}
|
|
1747
|
+
const { title, locations, kind } = this.resolveToolMetadata(
|
|
1748
|
+
params.toolName,
|
|
1749
|
+
params.args
|
|
1750
|
+
);
|
|
1751
|
+
const provenance = _ToolCallEmitter.resolveToolProvenance(
|
|
1752
|
+
params.toolName,
|
|
1753
|
+
params.subagentMeta
|
|
1754
|
+
);
|
|
1755
|
+
const updatesPreparedCall = params.phase !== "preparing" && this.preparedCallIds.delete(params.callId);
|
|
1756
|
+
await this.sendUpdate(
|
|
1757
|
+
createTranscriptToolCallStartUpdate({
|
|
1758
|
+
toolName: params.toolName,
|
|
1759
|
+
callId: params.callId,
|
|
1760
|
+
status: params.status || "pending",
|
|
1761
|
+
args: params.args,
|
|
1762
|
+
metadata: { title, locations, kind },
|
|
1763
|
+
timestamp: params.timestamp,
|
|
1764
|
+
asUpdate: updatesPreparedCall,
|
|
1765
|
+
extra: {
|
|
1766
|
+
...params.phase ? { phase: params.phase } : {},
|
|
1767
|
+
...params.subagentMeta,
|
|
1768
|
+
provenance: provenance.provenance,
|
|
1769
|
+
...provenance.serverId ? { serverId: provenance.serverId } : {}
|
|
1770
|
+
}
|
|
1771
|
+
})
|
|
1772
|
+
);
|
|
1773
|
+
if (params.phase === "preparing") {
|
|
1774
|
+
this.preparedCallIds.add(params.callId);
|
|
1775
|
+
}
|
|
1776
|
+
return true;
|
|
1777
|
+
}
|
|
1778
|
+
/**
|
|
1779
|
+
* Emits a terminal frame when a prepared tool call is discarded before
|
|
1780
|
+
* execution. TodoWrite remains represented exclusively by plan updates.
|
|
1781
|
+
*
|
|
1782
|
+
* @param callId - ID of the prepared tool call
|
|
1783
|
+
* @param toolName - Name of the prepared tool
|
|
1784
|
+
*/
|
|
1785
|
+
async emitPreparationDiscarded(callId, toolName) {
|
|
1786
|
+
if (this.isTodoWriteTool(toolName)) return;
|
|
1787
|
+
this.preparedCallIds.delete(callId);
|
|
1788
|
+
const provenance = _ToolCallEmitter.resolveToolProvenance(toolName);
|
|
1789
|
+
await this.sendUpdate({
|
|
1790
|
+
sessionUpdate: "tool_call_update",
|
|
1791
|
+
toolCallId: callId,
|
|
1792
|
+
status: "failed",
|
|
1793
|
+
content: [],
|
|
1794
|
+
_meta: {
|
|
1795
|
+
toolName,
|
|
1796
|
+
phase: "preparing",
|
|
1797
|
+
preparationDiscarded: true,
|
|
1798
|
+
provenance: provenance.provenance,
|
|
1799
|
+
...provenance.serverId ? { serverId: provenance.serverId } : {}
|
|
1800
|
+
}
|
|
1801
|
+
});
|
|
1802
|
+
}
|
|
1803
|
+
/**
|
|
1804
|
+
* Emits a tool call result event.
|
|
1805
|
+
* Handles TodoWriteTool specially by routing to plan updates.
|
|
1806
|
+
*
|
|
1807
|
+
* @param params - Tool call result parameters
|
|
1808
|
+
*/
|
|
1809
|
+
async emitResult(params) {
|
|
1810
|
+
if (this.isTodoWriteTool(params.toolName)) {
|
|
1811
|
+
if (params.subagentMeta) return;
|
|
1812
|
+
if (!params.success) return;
|
|
1813
|
+
const plan = this.planEmitter.extractPlan(
|
|
1814
|
+
params.resultDisplay,
|
|
1815
|
+
params.args
|
|
1816
|
+
);
|
|
1817
|
+
if (plan && (plan.todos.length > 0 || params.args && Array.isArray(params.args["todos"]))) {
|
|
1818
|
+
await this.planEmitter.emitPlan(plan, params.callId);
|
|
1819
|
+
}
|
|
1820
|
+
return;
|
|
1821
|
+
}
|
|
1822
|
+
this.preparedCallIds.delete(params.callId);
|
|
1823
|
+
const provenance = _ToolCallEmitter.resolveToolProvenance(
|
|
1824
|
+
params.toolName,
|
|
1825
|
+
params.subagentMeta
|
|
1826
|
+
);
|
|
1827
|
+
const update = createTranscriptToolCallResultUpdate({
|
|
1828
|
+
toolName: params.toolName,
|
|
1829
|
+
callId: params.callId,
|
|
1830
|
+
success: params.success,
|
|
1831
|
+
message: params.message,
|
|
1832
|
+
resultDisplay: stripBoundaryArtifactsFromRawOutput(params.resultDisplay),
|
|
1833
|
+
errorMessage: params.error?.message,
|
|
1834
|
+
artifacts: params.artifacts,
|
|
1835
|
+
contentPrefix: buildToolResultContentPrefix(params.resultDisplay),
|
|
1836
|
+
timestamp: params.timestamp,
|
|
1837
|
+
extra: {
|
|
1838
|
+
...params.subagentMeta,
|
|
1839
|
+
provenance: provenance.provenance,
|
|
1840
|
+
...provenance.serverId ? { serverId: provenance.serverId } : {}
|
|
1841
|
+
}
|
|
1842
|
+
});
|
|
1843
|
+
associateAcpToolResultArtifact(
|
|
1844
|
+
update,
|
|
1845
|
+
params.boundaryArtifact ?? toolResultBoundaryArtifact(
|
|
1846
|
+
params.persistedOutputFiles,
|
|
1847
|
+
params.artifacts
|
|
1848
|
+
)
|
|
1849
|
+
);
|
|
1850
|
+
await this.sendUpdate(update);
|
|
1851
|
+
}
|
|
1852
|
+
/**
|
|
1853
|
+
* Emits a tool call error event.
|
|
1854
|
+
* Use this for explicit error handling when not using emitResult.
|
|
1855
|
+
*
|
|
1856
|
+
* @param callId - The tool call ID
|
|
1857
|
+
* @param toolName - The tool name
|
|
1858
|
+
* @param error - The error that occurred
|
|
1859
|
+
* @param subagentMeta - Optional subagent metadata
|
|
1860
|
+
*/
|
|
1861
|
+
async emitError(callId, toolName, error, subagentMeta) {
|
|
1862
|
+
this.preparedCallIds.delete(callId);
|
|
1863
|
+
const provenance = _ToolCallEmitter.resolveToolProvenance(
|
|
1864
|
+
toolName,
|
|
1865
|
+
subagentMeta
|
|
1866
|
+
);
|
|
1867
|
+
await this.sendUpdate(
|
|
1868
|
+
createTranscriptToolCallResultUpdate({
|
|
1869
|
+
toolName,
|
|
1870
|
+
callId,
|
|
1871
|
+
success: false,
|
|
1872
|
+
errorMessage: error.message,
|
|
1873
|
+
extra: {
|
|
1874
|
+
...subagentMeta,
|
|
1875
|
+
provenance: provenance.provenance,
|
|
1876
|
+
...provenance.serverId ? { serverId: provenance.serverId } : {}
|
|
1877
|
+
}
|
|
1878
|
+
})
|
|
1879
|
+
);
|
|
1880
|
+
}
|
|
1881
|
+
/**
|
|
1882
|
+
* Resolve a tool's provenance for UI dispatch on tool_call events.
|
|
1883
|
+
* The SDK reads `_meta.
|
|
1884
|
+
* provenance` + `_meta.serverId` to render builtin / MCP-server-badge /
|
|
1885
|
+
* subagent-block differently. Without this stamping, the SDK falls
|
|
1886
|
+
* back to string-matching the toolName which can't reliably
|
|
1887
|
+
* distinguish builtin from subagent.
|
|
1888
|
+
*
|
|
1889
|
+
* Resolution rules:
|
|
1890
|
+
* - `subagentMeta` present → `'subagent'` (a Task tool / Codex
|
|
1891
|
+
* subagent / etc. wrapping its own tool calls)
|
|
1892
|
+
* - toolName matches `mcp__<server>__<tool>` → `'mcp'` with
|
|
1893
|
+
* `serverId: <server>`. Naming convention from
|
|
1894
|
+
* `packages/core/src/tools/mcp-tool.ts` in the
|
|
1895
|
+
* `@qwen-code/qwen-code-core` package — mirrors the SDK's same
|
|
1896
|
+
* heuristic fallback so SDK consumers stay consistent with
|
|
1897
|
+
* daemon classification.
|
|
1898
|
+
* - everything else → `'builtin'`
|
|
1899
|
+
*
|
|
1900
|
+
* Static + pure so it can be unit-tested without an emitter
|
|
1901
|
+
* instance. Exported via `ToolCallEmitter.resolveToolProvenance`.
|
|
1902
|
+
*/
|
|
1903
|
+
static resolveToolProvenance(toolName, subagentMeta) {
|
|
1904
|
+
if (subagentMeta !== void 0) {
|
|
1905
|
+
return { provenance: "subagent" };
|
|
1906
|
+
}
|
|
1907
|
+
if (toolName.startsWith("mcp__")) {
|
|
1908
|
+
const parts = toolName.split("__");
|
|
1909
|
+
if (parts.length >= 3 && parts[1] && parts[1].length > 0) {
|
|
1910
|
+
return { provenance: "mcp", serverId: parts[1] };
|
|
1911
|
+
}
|
|
1912
|
+
}
|
|
1913
|
+
return { provenance: "builtin" };
|
|
1914
|
+
}
|
|
1915
|
+
// ==================== Public Utilities ====================
|
|
1916
|
+
/**
|
|
1917
|
+
* Checks if a tool name is the TodoWriteTool.
|
|
1918
|
+
* Exposed for external use in components that need to check this.
|
|
1919
|
+
*/
|
|
1920
|
+
isTodoWriteTool(toolName) {
|
|
1921
|
+
return toolName === ToolNames.TODO_WRITE;
|
|
1922
|
+
}
|
|
1923
|
+
/**
|
|
1924
|
+
* Checks if a tool name is the ExitPlanModeTool.
|
|
1925
|
+
*/
|
|
1926
|
+
isExitPlanModeTool(toolName) {
|
|
1927
|
+
return toolName === ToolNames.EXIT_PLAN_MODE;
|
|
1928
|
+
}
|
|
1929
|
+
/**
|
|
1930
|
+
* Checks if a tool name is the EnterPlanModeTool.
|
|
1931
|
+
*/
|
|
1932
|
+
isEnterPlanModeTool(toolName) {
|
|
1933
|
+
return toolName === ToolNames.ENTER_PLAN_MODE;
|
|
1934
|
+
}
|
|
1935
|
+
/**
|
|
1936
|
+
* Resolves tool metadata from the registry.
|
|
1937
|
+
* Falls back to defaults if tool not found or build fails.
|
|
1938
|
+
*
|
|
1939
|
+
* @param toolName - Name of the tool
|
|
1940
|
+
* @param args - Tool call arguments (used to build invocation)
|
|
1941
|
+
*/
|
|
1942
|
+
resolveToolMetadata(toolName, args) {
|
|
1943
|
+
if (!hasFullSessionContext(this.ctx)) {
|
|
1944
|
+
const description = typeof args?.["description"] === "string" ? args["description"].trim() : "";
|
|
1945
|
+
return {
|
|
1946
|
+
title: description ? `${toolName}: ${description}` : toolName,
|
|
1947
|
+
locations: [],
|
|
1948
|
+
kind: "other"
|
|
1949
|
+
};
|
|
1950
|
+
}
|
|
1951
|
+
const toolRegistry = this.ctx.config.getToolRegistry();
|
|
1952
|
+
const tool = toolRegistry.getTool(toolName);
|
|
1953
|
+
let title = tool?.displayName ?? toolName;
|
|
1954
|
+
let locations = [];
|
|
1955
|
+
let kind = "other";
|
|
1956
|
+
if (tool && args) {
|
|
1957
|
+
try {
|
|
1958
|
+
const invocation = tool.build(args);
|
|
1959
|
+
title = `${title}: ${invocation.getDescription()}`;
|
|
1960
|
+
locations = invocation.toolLocations().map((loc) => ({
|
|
1961
|
+
path: loc.path,
|
|
1962
|
+
line: loc.line ?? null
|
|
1963
|
+
}));
|
|
1964
|
+
kind = this.mapToolKind(tool.kind, toolName);
|
|
1965
|
+
} catch {
|
|
1966
|
+
if (typeof args["description"] === "string") {
|
|
1967
|
+
title = `${title}: ${args["description"]}`;
|
|
1968
|
+
}
|
|
1969
|
+
if (tool.kind) {
|
|
1970
|
+
kind = this.mapToolKind(tool.kind, toolName);
|
|
1971
|
+
}
|
|
1972
|
+
}
|
|
1973
|
+
}
|
|
1974
|
+
return { title, locations, kind };
|
|
1975
|
+
}
|
|
1976
|
+
/**
|
|
1977
|
+
* Maps core Tool Kind enum to ACP ToolKind string literals.
|
|
1978
|
+
*
|
|
1979
|
+
* @param kind - The core Kind enum value
|
|
1980
|
+
* @param toolName - Optional tool name to handle special cases like exit_plan_mode
|
|
1981
|
+
*/
|
|
1982
|
+
mapToolKind(kind, toolName) {
|
|
1983
|
+
if (toolName && (this.isExitPlanModeTool(toolName) || this.isEnterPlanModeTool(toolName))) {
|
|
1984
|
+
return "switch_mode";
|
|
1985
|
+
}
|
|
1986
|
+
return KIND_MAP[kind] ?? "other";
|
|
1987
|
+
}
|
|
1988
|
+
};
|
|
1989
|
+
function buildToolResultContentPrefix(resultDisplay) {
|
|
1990
|
+
if (!isVisionBridgeNoticeDisplay(resultDisplay)) return [];
|
|
1991
|
+
return [
|
|
1992
|
+
{
|
|
1993
|
+
type: "content",
|
|
1994
|
+
content: {
|
|
1995
|
+
type: "text",
|
|
1996
|
+
text: sanitizeTerminalText(
|
|
1997
|
+
formatVisionBridgeNoticeDisplay(resultDisplay)
|
|
1998
|
+
)
|
|
1999
|
+
}
|
|
2000
|
+
}
|
|
2001
|
+
];
|
|
2002
|
+
}
|
|
2003
|
+
__name(buildToolResultContentPrefix, "buildToolResultContentPrefix");
|
|
2004
|
+
|
|
2005
|
+
// packages/cli/src/acp-integration/session/history-replayer.ts
|
|
2006
|
+
var HistoryReplayer = class {
|
|
2007
|
+
constructor(ctx) {
|
|
2008
|
+
this.ctx = ctx;
|
|
2009
|
+
this.toolCallEmitter = new ToolCallEmitter(ctx);
|
|
2010
|
+
this.machine = this.createMachine();
|
|
2011
|
+
}
|
|
2012
|
+
static {
|
|
2013
|
+
__name(this, "HistoryReplayer");
|
|
2014
|
+
}
|
|
2015
|
+
toolCallEmitter;
|
|
2016
|
+
machine;
|
|
2017
|
+
async replay(records, gaps, options = {}) {
|
|
2018
|
+
try {
|
|
2019
|
+
if (options.goalBootstrap) {
|
|
2020
|
+
const update = {
|
|
2021
|
+
sessionUpdate: "agent_message_chunk",
|
|
2022
|
+
content: { type: "text", text: "" },
|
|
2023
|
+
_meta: {
|
|
2024
|
+
...options.goalBootstrap.goalState ? { goalState: options.goalBootstrap.goalState } : {},
|
|
2025
|
+
goalStatus: options.goalBootstrap.goalStatus
|
|
2026
|
+
}
|
|
2027
|
+
};
|
|
2028
|
+
await this.sendUpdate(update);
|
|
2029
|
+
}
|
|
2030
|
+
await this.replayPage(records, {
|
|
2031
|
+
finalizeDangling: true,
|
|
2032
|
+
gaps,
|
|
2033
|
+
...options.initialGoalState ? { goalState: options.initialGoalState } : {},
|
|
2034
|
+
...options.initialGoalCause ? { goalCause: options.initialGoalCause } : {}
|
|
2035
|
+
});
|
|
2036
|
+
} finally {
|
|
2037
|
+
this.setActiveRecordId(null);
|
|
2038
|
+
}
|
|
2039
|
+
}
|
|
2040
|
+
static v2GoalBootstrap(rawGoalState, rawGoalCause) {
|
|
2041
|
+
const goalState = parseGoalSnapshotV2(rawGoalState);
|
|
2042
|
+
const goalCause = parseGoalStateCause(rawGoalCause);
|
|
2043
|
+
if (!goalState?.goal || goalState.goal.status !== "active" || !goalCause) {
|
|
2044
|
+
return void 0;
|
|
2045
|
+
}
|
|
2046
|
+
const projection = projectGoalStateToLegacy({
|
|
2047
|
+
v: 2,
|
|
2048
|
+
cause: goalCause,
|
|
2049
|
+
snapshot: goalState
|
|
2050
|
+
});
|
|
2051
|
+
const { type: _type, kind, ...goalStatus } = projection.goalStatus;
|
|
2052
|
+
if (kind !== "set" && kind !== "checking") {
|
|
2053
|
+
return void 0;
|
|
2054
|
+
}
|
|
2055
|
+
return { goalStatus: { ...goalStatus, kind }, goalState };
|
|
2056
|
+
}
|
|
2057
|
+
async replayPage(records, options = {}) {
|
|
2058
|
+
this.machine = this.createMachine(options);
|
|
2059
|
+
let replayError;
|
|
2060
|
+
try {
|
|
2061
|
+
for (const record of records) {
|
|
2062
|
+
for (const emission of this.machine.project(record)) {
|
|
2063
|
+
this.setActiveRecordId(
|
|
2064
|
+
emission.sourceRecordId,
|
|
2065
|
+
emission.sourceTimestamp
|
|
2066
|
+
);
|
|
2067
|
+
await this.sendUpdate(emission.update);
|
|
2068
|
+
}
|
|
2069
|
+
}
|
|
2070
|
+
} catch (error) {
|
|
2071
|
+
replayError = error;
|
|
2072
|
+
}
|
|
2073
|
+
let danglingError;
|
|
2074
|
+
if (options.finalizeDangling === true) {
|
|
2075
|
+
for (const emission of this.machine.finalize()) {
|
|
2076
|
+
this.setActiveRecordId(
|
|
2077
|
+
emission.sourceRecordId,
|
|
2078
|
+
emission.sourceTimestamp
|
|
2079
|
+
);
|
|
2080
|
+
try {
|
|
2081
|
+
await this.sendUpdate(emission.update);
|
|
2082
|
+
} catch (error) {
|
|
2083
|
+
danglingError ??= error;
|
|
2084
|
+
}
|
|
2085
|
+
}
|
|
2086
|
+
}
|
|
2087
|
+
const replay = this.machine.snapshot();
|
|
2088
|
+
this.copyCumulativeUsage(replay);
|
|
2089
|
+
const state = {
|
|
2090
|
+
pendingToolCalls: options.finalizeDangling === true ? [] : replay.pendingToolCalls.map(toLegacyPendingToolCall),
|
|
2091
|
+
replay
|
|
2092
|
+
};
|
|
2093
|
+
this.setActiveRecordId(null);
|
|
2094
|
+
if (replayError && danglingError) {
|
|
2095
|
+
throw new AggregateError(
|
|
2096
|
+
[replayError, danglingError],
|
|
2097
|
+
"Replay and dangling-cleanup both failed"
|
|
2098
|
+
);
|
|
2099
|
+
}
|
|
2100
|
+
if (replayError) throw replayError;
|
|
2101
|
+
if (danglingError) throw danglingError;
|
|
2102
|
+
return state;
|
|
2103
|
+
}
|
|
2104
|
+
getPendingToolCalls() {
|
|
2105
|
+
return this.machine.snapshot().pendingToolCalls.map(toLegacyPendingToolCall);
|
|
2106
|
+
}
|
|
2107
|
+
getReplayState() {
|
|
2108
|
+
return this.machine.snapshot();
|
|
2109
|
+
}
|
|
2110
|
+
createMachine(options = {}) {
|
|
2111
|
+
const cumulative = this.ctx.cumulativeUsage;
|
|
2112
|
+
const initialState = {
|
|
2113
|
+
v: 1,
|
|
2114
|
+
pendingToolCalls: (options.pendingToolCalls ?? []).map(
|
|
2115
|
+
toPendingTranscriptToolCall
|
|
2116
|
+
),
|
|
2117
|
+
cumulativeUsage: cumulative ? { ...cumulative } : {
|
|
2118
|
+
promptTokens: 0,
|
|
2119
|
+
cachedTokens: 0,
|
|
2120
|
+
candidateTokens: 0,
|
|
2121
|
+
apiTimeMs: 0
|
|
2122
|
+
},
|
|
2123
|
+
...options.goalState ? { goalState: options.goalState } : {},
|
|
2124
|
+
...options.goalCause ? { goalCause: options.goalCause } : {}
|
|
2125
|
+
};
|
|
2126
|
+
return createTranscriptReplayMachine({
|
|
2127
|
+
initialState,
|
|
2128
|
+
gaps: options.gaps,
|
|
2129
|
+
presentation: this.presentationAdapter(),
|
|
2130
|
+
onDiagnostic: /* @__PURE__ */ __name((diagnostic) => {
|
|
2131
|
+
if (diagnostic.code === "malformed_part" && diagnostic.path === "systemPayload.outputHistoryItems.goalStatus.condition") {
|
|
2132
|
+
writeStderrLineSafe(`qwen: ${diagnostic.message}`);
|
|
2133
|
+
}
|
|
2134
|
+
}, "onDiagnostic")
|
|
2135
|
+
});
|
|
2136
|
+
}
|
|
2137
|
+
presentationAdapter() {
|
|
2138
|
+
return {
|
|
2139
|
+
resolveToolMetadata: /* @__PURE__ */ __name((toolName, args) => this.toolCallEmitter.resolveToolMetadata(toolName, { ...args }), "resolveToolMetadata"),
|
|
2140
|
+
formatHistoryGap: /* @__PURE__ */ __name((gap) => formatHistoryGapNotice(gap), "formatHistoryGap"),
|
|
2141
|
+
buildToolResultContentPrefix
|
|
2142
|
+
};
|
|
2143
|
+
}
|
|
2144
|
+
async sendUpdate(update) {
|
|
2145
|
+
if (this.ctx.messageRewriter) {
|
|
2146
|
+
await this.ctx.messageRewriter.interceptUpdate(update);
|
|
2147
|
+
return;
|
|
2148
|
+
}
|
|
2149
|
+
await this.ctx.sendUpdate(update);
|
|
2150
|
+
}
|
|
2151
|
+
copyCumulativeUsage(state) {
|
|
2152
|
+
const cumulative = this.ctx.cumulativeUsage;
|
|
2153
|
+
if (!cumulative) return;
|
|
2154
|
+
cumulative.promptTokens = state.cumulativeUsage.promptTokens;
|
|
2155
|
+
cumulative.cachedTokens = state.cumulativeUsage.cachedTokens;
|
|
2156
|
+
cumulative.candidateTokens = state.cumulativeUsage.candidateTokens;
|
|
2157
|
+
cumulative.apiTimeMs = state.cumulativeUsage.apiTimeMs;
|
|
2158
|
+
}
|
|
2159
|
+
setActiveRecordId(recordId, timestamp) {
|
|
2160
|
+
this.ctx.setActiveRecordId?.(recordId, timestamp);
|
|
2161
|
+
}
|
|
2162
|
+
};
|
|
2163
|
+
function toPendingTranscriptToolCall(pending) {
|
|
2164
|
+
return {
|
|
2165
|
+
callId: pending.callId,
|
|
2166
|
+
toolName: pending.toolName,
|
|
2167
|
+
sourceRecordId: pending.recordId,
|
|
2168
|
+
...pending.timestamp ? { sourceTimestamp: pending.timestamp } : {}
|
|
2169
|
+
};
|
|
2170
|
+
}
|
|
2171
|
+
__name(toPendingTranscriptToolCall, "toPendingTranscriptToolCall");
|
|
2172
|
+
function toLegacyPendingToolCall(pending) {
|
|
2173
|
+
return {
|
|
2174
|
+
callId: pending.callId,
|
|
2175
|
+
toolName: pending.toolName,
|
|
2176
|
+
recordId: pending.sourceRecordId,
|
|
2177
|
+
...pending.sourceTimestamp ? { timestamp: pending.sourceTimestamp } : {}
|
|
2178
|
+
};
|
|
2179
|
+
}
|
|
2180
|
+
__name(toLegacyPendingToolCall, "toLegacyPendingToolCall");
|
|
2181
|
+
|
|
2182
|
+
// packages/cli/src/services/setup-github.ts
|
|
2183
|
+
init_esbuild_shims();
|
|
2184
|
+
import { promises as fsp } from "node:fs";
|
|
2185
|
+
import * as path from "node:path";
|
|
2186
|
+
|
|
2187
|
+
// packages/cli/src/utils/gitUtils.ts
|
|
2188
|
+
init_esbuild_shims();
|
|
2189
|
+
import * as childProcess from "node:child_process";
|
|
2190
|
+
var debugLogger = createDebugLogger("GIT");
|
|
2191
|
+
async function runGit(args, opts = {}) {
|
|
2192
|
+
return await new Promise((resolve2, reject) => {
|
|
2193
|
+
childProcess.execFile(
|
|
2194
|
+
"git",
|
|
2195
|
+
args,
|
|
2196
|
+
{
|
|
2197
|
+
encoding: "utf-8",
|
|
2198
|
+
...opts.cwd ? { cwd: opts.cwd } : {}
|
|
2199
|
+
},
|
|
2200
|
+
(err, stdout) => {
|
|
2201
|
+
if (err) {
|
|
2202
|
+
reject(err);
|
|
2203
|
+
return;
|
|
2204
|
+
}
|
|
2205
|
+
resolve2(String(stdout ?? "").trim());
|
|
2206
|
+
}
|
|
2207
|
+
);
|
|
2208
|
+
});
|
|
2209
|
+
}
|
|
2210
|
+
__name(runGit, "runGit");
|
|
2211
|
+
var isGitHubRepositoryAsync = /* @__PURE__ */ __name(async (opts = {}) => {
|
|
2212
|
+
try {
|
|
2213
|
+
const remotes = await runGit(["remote", "-v"], opts);
|
|
2214
|
+
return remotes.split("\n").some((line) => {
|
|
2215
|
+
const remoteUrl = line.trim().split(/\s+/)[1];
|
|
2216
|
+
return remoteUrl ? isGitHubRemoteUrl(remoteUrl) : false;
|
|
2217
|
+
});
|
|
2218
|
+
} catch (_error) {
|
|
2219
|
+
debugLogger.debug(`Failed to get git remote:`, _error);
|
|
2220
|
+
return false;
|
|
2221
|
+
}
|
|
2222
|
+
}, "isGitHubRepositoryAsync");
|
|
2223
|
+
function isGitHubRemoteUrl(remoteUrl) {
|
|
2224
|
+
if (remoteUrl.startsWith("git@github.com:")) {
|
|
2225
|
+
return true;
|
|
2226
|
+
}
|
|
2227
|
+
if (remoteUrl.startsWith("git@")) {
|
|
2228
|
+
return false;
|
|
2229
|
+
}
|
|
2230
|
+
try {
|
|
2231
|
+
return new URL(remoteUrl).hostname === "github.com";
|
|
2232
|
+
} catch {
|
|
2233
|
+
return false;
|
|
2234
|
+
}
|
|
2235
|
+
}
|
|
2236
|
+
__name(isGitHubRemoteUrl, "isGitHubRemoteUrl");
|
|
2237
|
+
var getGitRepoRootAsync = /* @__PURE__ */ __name(async (opts = {}) => {
|
|
2238
|
+
const gitRepoRoot = await runGit(["rev-parse", "--show-toplevel"], opts);
|
|
2239
|
+
if (!gitRepoRoot) {
|
|
2240
|
+
throw new Error(`Git repo returned empty value`);
|
|
2241
|
+
}
|
|
2242
|
+
return gitRepoRoot;
|
|
2243
|
+
}, "getGitRepoRootAsync");
|
|
2244
|
+
var getLatestGitHubRelease = /* @__PURE__ */ __name(async (proxy) => {
|
|
2245
|
+
try {
|
|
2246
|
+
const controller = new AbortController();
|
|
2247
|
+
const endpoint = `https://api.github.com/repos/QwenLM/qwen-code-action/releases/latest`;
|
|
2248
|
+
const dispatcher = proxy ? new (await loadUndici()).ProxyAgent(proxy) : void 0;
|
|
2249
|
+
const response = await fetch(endpoint, {
|
|
2250
|
+
method: "GET",
|
|
2251
|
+
headers: {
|
|
2252
|
+
Accept: "application/vnd.github+json",
|
|
2253
|
+
"Content-Type": "application/json",
|
|
2254
|
+
"X-GitHub-Api-Version": "2022-11-28"
|
|
2255
|
+
},
|
|
2256
|
+
dispatcher,
|
|
2257
|
+
signal: AbortSignal.any([AbortSignal.timeout(3e4), controller.signal])
|
|
2258
|
+
});
|
|
2259
|
+
if (!response.ok) {
|
|
2260
|
+
throw new Error(
|
|
2261
|
+
`Invalid response code: ${response.status} - ${response.statusText}`
|
|
2262
|
+
);
|
|
2263
|
+
}
|
|
2264
|
+
const releaseTag = (await response.json()).tag_name;
|
|
2265
|
+
if (!releaseTag) {
|
|
2266
|
+
throw new Error(`Response did not include tag_name field`);
|
|
2267
|
+
}
|
|
2268
|
+
return releaseTag;
|
|
2269
|
+
} catch (_error) {
|
|
2270
|
+
debugLogger.debug(
|
|
2271
|
+
`Failed to determine latest qwen-code-action release:`,
|
|
2272
|
+
_error
|
|
2273
|
+
);
|
|
2274
|
+
throw new Error(
|
|
2275
|
+
`Unable to determine the latest qwen-code-action release on GitHub.`
|
|
2276
|
+
);
|
|
2277
|
+
}
|
|
2278
|
+
}, "getLatestGitHubRelease");
|
|
2279
|
+
async function getGitHubRepoInfoAsync(opts = {}) {
|
|
2280
|
+
return parseGitHubRepoInfo(
|
|
2281
|
+
await runGit(["remote", "get-url", "origin"], opts)
|
|
2282
|
+
);
|
|
2283
|
+
}
|
|
2284
|
+
__name(getGitHubRepoInfoAsync, "getGitHubRepoInfoAsync");
|
|
2285
|
+
function parseGitHubRepoInfo(remoteUrl) {
|
|
2286
|
+
let urlToParse = remoteUrl;
|
|
2287
|
+
if (remoteUrl.startsWith("git@github.com:")) {
|
|
2288
|
+
urlToParse = remoteUrl.replace("git@github.com:", "");
|
|
2289
|
+
} else if (remoteUrl.startsWith("git@")) {
|
|
2290
|
+
throw new Error(
|
|
2291
|
+
`Owner & repo could not be extracted from remote URL: ${remoteUrl}`
|
|
2292
|
+
);
|
|
2293
|
+
}
|
|
2294
|
+
let parsedUrl;
|
|
2295
|
+
try {
|
|
2296
|
+
parsedUrl = new URL(urlToParse, "https://github.com");
|
|
2297
|
+
} catch {
|
|
2298
|
+
throw new Error(
|
|
2299
|
+
`Owner & repo could not be extracted from remote URL: ${remoteUrl}`
|
|
2300
|
+
);
|
|
2301
|
+
}
|
|
2302
|
+
if (parsedUrl.hostname !== "github.com") {
|
|
2303
|
+
throw new Error(
|
|
2304
|
+
`Owner & repo could not be extracted from remote URL: ${remoteUrl}`
|
|
2305
|
+
);
|
|
2306
|
+
}
|
|
2307
|
+
const parts = parsedUrl.pathname.split("/").filter((part) => part !== "");
|
|
2308
|
+
if (parts.length !== 2 || !parts[0] || !parts[1]) {
|
|
2309
|
+
throw new Error(
|
|
2310
|
+
`Owner & repo could not be extracted from remote URL: ${remoteUrl}`
|
|
2311
|
+
);
|
|
2312
|
+
}
|
|
2313
|
+
return { owner: parts[0], repo: parts[1].replace(/\.git$/, "") };
|
|
2314
|
+
}
|
|
2315
|
+
__name(parseGitHubRepoInfo, "parseGitHubRepoInfo");
|
|
2316
|
+
|
|
2317
|
+
// packages/cli/src/services/setup-github.ts
|
|
2318
|
+
var debugLogger2 = createDebugLogger("SETUP_GITHUB");
|
|
2319
|
+
var GITHUB_WORKFLOW_PATHS = [
|
|
2320
|
+
"qwen-dispatch/qwen-dispatch.yml",
|
|
2321
|
+
"qwen-assistant/qwen-invoke.yml",
|
|
2322
|
+
"issue-triage/qwen-triage.yml",
|
|
2323
|
+
"issue-triage/qwen-scheduled-triage.yml",
|
|
2324
|
+
"pr-review/qwen-review.yml"
|
|
2325
|
+
];
|
|
2326
|
+
var GITIGNORE_ENTRIES = [".qwen/", "gha-creds-*.json"];
|
|
2327
|
+
var MAX_WORKFLOW_DOWNLOAD_BYTES = 5 * 1024 * 1024;
|
|
2328
|
+
var SetupGithubError = class extends Error {
|
|
2329
|
+
static {
|
|
2330
|
+
__name(this, "SetupGithubError");
|
|
2331
|
+
}
|
|
2332
|
+
code;
|
|
2333
|
+
status;
|
|
2334
|
+
partial;
|
|
2335
|
+
partialResult;
|
|
2336
|
+
constructor(code, message, status, partialResult) {
|
|
2337
|
+
super(message);
|
|
2338
|
+
this.name = "SetupGithubError";
|
|
2339
|
+
this.code = code;
|
|
2340
|
+
this.status = status;
|
|
2341
|
+
this.partial = partialResult !== void 0;
|
|
2342
|
+
this.partialResult = partialResult;
|
|
2343
|
+
}
|
|
2344
|
+
};
|
|
2345
|
+
function isWorkspaceGenerationClosed(error) {
|
|
2346
|
+
return Boolean(
|
|
2347
|
+
error && typeof error === "object" && "code" in error && error.code === "workspace_generation_closed"
|
|
2348
|
+
);
|
|
2349
|
+
}
|
|
2350
|
+
__name(isWorkspaceGenerationClosed, "isWorkspaceGenerationClosed");
|
|
2351
|
+
var nodeFileOps = {
|
|
2352
|
+
assertCanWrite() {
|
|
2353
|
+
},
|
|
2354
|
+
async ensureWorkflowDirectory(gitRepoRoot) {
|
|
2355
|
+
await fsp.mkdir(path.join(gitRepoRoot, ".github", "workflows"), {
|
|
2356
|
+
recursive: true
|
|
2357
|
+
});
|
|
2358
|
+
},
|
|
2359
|
+
async writeTextFile(gitRepoRoot, relativePath, content) {
|
|
2360
|
+
const target = path.join(gitRepoRoot, relativePath);
|
|
2361
|
+
await fsp.writeFile(target, content, { mode: 420 });
|
|
2362
|
+
return { sizeBytes: Buffer.byteLength(content, "utf8") };
|
|
2363
|
+
},
|
|
2364
|
+
async readTextFile(gitRepoRoot, relativePath) {
|
|
2365
|
+
try {
|
|
2366
|
+
return await fsp.readFile(path.join(gitRepoRoot, relativePath), "utf8");
|
|
2367
|
+
} catch (error) {
|
|
2368
|
+
if (error.code === "ENOENT") {
|
|
2369
|
+
return void 0;
|
|
2370
|
+
}
|
|
2371
|
+
throw error;
|
|
2372
|
+
}
|
|
2373
|
+
}
|
|
2374
|
+
};
|
|
2375
|
+
async function setupGithub(options = {}) {
|
|
2376
|
+
const cwd = options.cwd ?? process.cwd();
|
|
2377
|
+
const fileOps = options.fileOps ?? nodeFileOps;
|
|
2378
|
+
if (!await isGitHubRepositoryAsync({ cwd })) {
|
|
2379
|
+
throw new SetupGithubError(
|
|
2380
|
+
"github_repository_not_found",
|
|
2381
|
+
"Unable to determine the GitHub repository. /setup-github must be run from a git repository.",
|
|
2382
|
+
400
|
|
2383
|
+
);
|
|
2384
|
+
}
|
|
2385
|
+
let gitRepoRoot;
|
|
2386
|
+
try {
|
|
2387
|
+
gitRepoRoot = await getGitRepoRootAsync({ cwd });
|
|
2388
|
+
} catch (error) {
|
|
2389
|
+
debugLogger2.debug("Failed to get git repo root:", error);
|
|
2390
|
+
throw new SetupGithubError(
|
|
2391
|
+
"github_repository_not_found",
|
|
2392
|
+
"Unable to determine the GitHub repository. /setup-github must be run from a git repository.",
|
|
2393
|
+
400
|
|
2394
|
+
);
|
|
2395
|
+
}
|
|
2396
|
+
if (options.workspaceRoot) {
|
|
2397
|
+
const [gitRootReal, workspaceReal] = await Promise.all([
|
|
2398
|
+
realpathOrResolve(gitRepoRoot),
|
|
2399
|
+
realpathOrResolve(options.workspaceRoot)
|
|
2400
|
+
]);
|
|
2401
|
+
if (gitRootReal !== workspaceReal) {
|
|
2402
|
+
throw new SetupGithubError(
|
|
2403
|
+
"github_git_root_mismatch",
|
|
2404
|
+
"The Git repository root must match the daemon workspace root.",
|
|
2405
|
+
400
|
|
2406
|
+
);
|
|
2407
|
+
}
|
|
2408
|
+
}
|
|
2409
|
+
fileOps.assertCanWrite?.();
|
|
2410
|
+
let releaseTag;
|
|
2411
|
+
try {
|
|
2412
|
+
releaseTag = await getLatestGitHubRelease(options.proxy);
|
|
2413
|
+
} catch (error) {
|
|
2414
|
+
writeStderrLine(
|
|
2415
|
+
`qwen setup-github: failed to determine latest qwen-code-action release: ${error instanceof Error ? error.message : String(error)}`
|
|
2416
|
+
);
|
|
2417
|
+
debugLogger2.debug(
|
|
2418
|
+
"Failed to determine latest qwen-code-action release:",
|
|
2419
|
+
error
|
|
2420
|
+
);
|
|
2421
|
+
throw new SetupGithubError(
|
|
2422
|
+
"github_release_lookup_failed",
|
|
2423
|
+
"Unable to determine the latest qwen-code-action release on GitHub.",
|
|
2424
|
+
502
|
|
2425
|
+
);
|
|
2426
|
+
}
|
|
2427
|
+
const readmeUrl = `https://github.com/QwenLM/qwen-code-action/blob/${releaseTag}/README.md#quick-start`;
|
|
2428
|
+
const secretsUrl = await resolveSecretsUrl(cwd);
|
|
2429
|
+
const downloads = await downloadWorkflows({
|
|
2430
|
+
releaseTag,
|
|
2431
|
+
proxy: options.proxy,
|
|
2432
|
+
abortSignal: options.abortSignal,
|
|
2433
|
+
fetchImpl: options.fetchImpl ?? fetch
|
|
2434
|
+
});
|
|
2435
|
+
const result = {
|
|
2436
|
+
kind: "github_setup",
|
|
2437
|
+
workspaceCwd: options.workspaceRoot ?? gitRepoRoot,
|
|
2438
|
+
gitRepoRoot,
|
|
2439
|
+
releaseTag,
|
|
2440
|
+
readmeUrl,
|
|
2441
|
+
...secretsUrl ? { secretsUrl } : {},
|
|
2442
|
+
workflows: [],
|
|
2443
|
+
gitignore: { path: ".gitignore", status: "skipped" },
|
|
2444
|
+
warnings: []
|
|
2445
|
+
};
|
|
2446
|
+
result.gitignore = await updateGitignore(gitRepoRoot, fileOps);
|
|
2447
|
+
if (result.gitignore.status === "failed") {
|
|
2448
|
+
result.warnings.push("Failed to update .gitignore.");
|
|
2449
|
+
}
|
|
2450
|
+
try {
|
|
2451
|
+
await fileOps.ensureWorkflowDirectory(gitRepoRoot);
|
|
2452
|
+
for (const workflow of downloads) {
|
|
2453
|
+
const relativePath = path.posix.join(
|
|
2454
|
+
".github",
|
|
2455
|
+
"workflows",
|
|
2456
|
+
path.posix.basename(workflow.sourcePath)
|
|
2457
|
+
);
|
|
2458
|
+
try {
|
|
2459
|
+
const write = await fileOps.writeTextFile(
|
|
2460
|
+
gitRepoRoot,
|
|
2461
|
+
relativePath,
|
|
2462
|
+
workflow.content
|
|
2463
|
+
);
|
|
2464
|
+
result.workflows.push({
|
|
2465
|
+
sourcePath: workflow.sourcePath,
|
|
2466
|
+
path: relativePath,
|
|
2467
|
+
status: "written",
|
|
2468
|
+
sizeBytes: write.sizeBytes
|
|
2469
|
+
});
|
|
2470
|
+
} catch (error) {
|
|
2471
|
+
if (isWorkspaceGenerationClosed(error)) throw error;
|
|
2472
|
+
result.partial = true;
|
|
2473
|
+
result.workflows.push({
|
|
2474
|
+
sourcePath: workflow.sourcePath,
|
|
2475
|
+
path: relativePath,
|
|
2476
|
+
status: "failed",
|
|
2477
|
+
error: error instanceof Error ? error.message : String(error)
|
|
2478
|
+
});
|
|
2479
|
+
throw new SetupGithubError(
|
|
2480
|
+
"github_workflow_write_failed",
|
|
2481
|
+
`Unable to write ${relativePath}.`,
|
|
2482
|
+
500,
|
|
2483
|
+
result
|
|
2484
|
+
);
|
|
2485
|
+
}
|
|
2486
|
+
}
|
|
2487
|
+
} catch (error) {
|
|
2488
|
+
if (isWorkspaceGenerationClosed(error)) throw error;
|
|
2489
|
+
if (error instanceof SetupGithubError) throw error;
|
|
2490
|
+
throw new SetupGithubError(
|
|
2491
|
+
"github_workflow_write_failed",
|
|
2492
|
+
"Unable to create .github/workflows.",
|
|
2493
|
+
500,
|
|
2494
|
+
result
|
|
2495
|
+
);
|
|
2496
|
+
}
|
|
2497
|
+
return result;
|
|
2498
|
+
}
|
|
2499
|
+
__name(setupGithub, "setupGithub");
|
|
2500
|
+
async function updateGitignore(gitRepoRoot, fileOps = nodeFileOps) {
|
|
2501
|
+
try {
|
|
2502
|
+
const existingContent = await fileOps.readTextFile(
|
|
2503
|
+
gitRepoRoot,
|
|
2504
|
+
".gitignore"
|
|
2505
|
+
);
|
|
2506
|
+
if (existingContent === void 0) {
|
|
2507
|
+
const content = GITIGNORE_ENTRIES.join("\n") + "\n";
|
|
2508
|
+
await fileOps.writeTextFile(gitRepoRoot, ".gitignore", content);
|
|
2509
|
+
return {
|
|
2510
|
+
path: ".gitignore",
|
|
2511
|
+
status: "created",
|
|
2512
|
+
added: [...GITIGNORE_ENTRIES]
|
|
2513
|
+
};
|
|
2514
|
+
}
|
|
2515
|
+
const missingEntries = GITIGNORE_ENTRIES.filter(
|
|
2516
|
+
(entry) => !existingContent.split(/\r?\n/).some((line) => line.split("#")[0].trim() === entry)
|
|
2517
|
+
);
|
|
2518
|
+
if (missingEntries.length === 0) {
|
|
2519
|
+
return { path: ".gitignore", status: "unchanged" };
|
|
2520
|
+
}
|
|
2521
|
+
const nextContent = existingContent + "\n" + missingEntries.join("\n") + "\n";
|
|
2522
|
+
await fileOps.writeTextFile(gitRepoRoot, ".gitignore", nextContent);
|
|
2523
|
+
return {
|
|
2524
|
+
path: ".gitignore",
|
|
2525
|
+
status: "updated",
|
|
2526
|
+
added: missingEntries
|
|
2527
|
+
};
|
|
2528
|
+
} catch (error) {
|
|
2529
|
+
if (isWorkspaceGenerationClosed(error)) throw error;
|
|
2530
|
+
debugLogger2.debug("Failed to update .gitignore:", error);
|
|
2531
|
+
return {
|
|
2532
|
+
path: ".gitignore",
|
|
2533
|
+
status: "failed",
|
|
2534
|
+
error: error instanceof Error ? error.message : String(error)
|
|
2535
|
+
};
|
|
2536
|
+
}
|
|
2537
|
+
}
|
|
2538
|
+
__name(updateGitignore, "updateGitignore");
|
|
2539
|
+
async function downloadWorkflows(options) {
|
|
2540
|
+
const internalAbort = new AbortController();
|
|
2541
|
+
try {
|
|
2542
|
+
const dispatcher = options.proxy ? new (await loadUndici()).ProxyAgent(options.proxy) : void 0;
|
|
2543
|
+
return await Promise.all(
|
|
2544
|
+
GITHUB_WORKFLOW_PATHS.map(async (workflow) => {
|
|
2545
|
+
const endpoint = `https://raw.githubusercontent.com/QwenLM/qwen-code-action/refs/tags/${options.releaseTag}/examples/workflows/${workflow}`;
|
|
2546
|
+
const response = await options.fetchImpl(endpoint, {
|
|
2547
|
+
method: "GET",
|
|
2548
|
+
dispatcher,
|
|
2549
|
+
signal: AbortSignal.any([
|
|
2550
|
+
AbortSignal.timeout(3e4),
|
|
2551
|
+
internalAbort.signal,
|
|
2552
|
+
...options.abortSignal ? [options.abortSignal] : []
|
|
2553
|
+
])
|
|
2554
|
+
});
|
|
2555
|
+
if (!response.ok) {
|
|
2556
|
+
throw new Error(
|
|
2557
|
+
`Invalid response code downloading ${endpoint}: ${response.status} - ${response.statusText}`
|
|
2558
|
+
);
|
|
2559
|
+
}
|
|
2560
|
+
return {
|
|
2561
|
+
sourcePath: workflow,
|
|
2562
|
+
content: await readResponseTextWithLimit(response, workflow)
|
|
2563
|
+
};
|
|
2564
|
+
})
|
|
2565
|
+
);
|
|
2566
|
+
} catch (error) {
|
|
2567
|
+
internalAbort.abort();
|
|
2568
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
2569
|
+
debugLogger2.debug("Failed to download qwen-code-action workflows:", error);
|
|
2570
|
+
throw new SetupGithubError(
|
|
2571
|
+
"github_workflow_download_failed",
|
|
2572
|
+
`Unable to download qwen-code-action workflows from GitHub. ${message}`,
|
|
2573
|
+
502
|
|
2574
|
+
);
|
|
2575
|
+
}
|
|
2576
|
+
}
|
|
2577
|
+
__name(downloadWorkflows, "downloadWorkflows");
|
|
2578
|
+
async function readResponseTextWithLimit(response, sourcePath) {
|
|
2579
|
+
const contentLength = response.headers.get("content-length");
|
|
2580
|
+
if (contentLength !== null) {
|
|
2581
|
+
const parsedLength = Number(contentLength);
|
|
2582
|
+
if (Number.isFinite(parsedLength) && parsedLength > MAX_WORKFLOW_DOWNLOAD_BYTES) {
|
|
2583
|
+
throw new Error(
|
|
2584
|
+
`${sourcePath} exceeds download limit of ${MAX_WORKFLOW_DOWNLOAD_BYTES} bytes`
|
|
2585
|
+
);
|
|
2586
|
+
}
|
|
2587
|
+
}
|
|
2588
|
+
if (!response.body) return "";
|
|
2589
|
+
const reader = response.body.getReader();
|
|
2590
|
+
const chunks = [];
|
|
2591
|
+
let totalBytes = 0;
|
|
2592
|
+
try {
|
|
2593
|
+
while (true) {
|
|
2594
|
+
const { done, value } = await reader.read();
|
|
2595
|
+
if (done) break;
|
|
2596
|
+
if (!value) continue;
|
|
2597
|
+
totalBytes += value.byteLength;
|
|
2598
|
+
if (totalBytes > MAX_WORKFLOW_DOWNLOAD_BYTES) {
|
|
2599
|
+
await reader.cancel().catch(() => {
|
|
2600
|
+
});
|
|
2601
|
+
throw new Error(
|
|
2602
|
+
`${sourcePath} exceeds download limit of ${MAX_WORKFLOW_DOWNLOAD_BYTES} bytes`
|
|
2603
|
+
);
|
|
2604
|
+
}
|
|
2605
|
+
chunks.push(value);
|
|
2606
|
+
}
|
|
2607
|
+
} finally {
|
|
2608
|
+
reader.releaseLock();
|
|
2609
|
+
}
|
|
2610
|
+
const body = new Uint8Array(totalBytes);
|
|
2611
|
+
let offset = 0;
|
|
2612
|
+
for (const chunk of chunks) {
|
|
2613
|
+
body.set(chunk, offset);
|
|
2614
|
+
offset += chunk.byteLength;
|
|
2615
|
+
}
|
|
2616
|
+
return new TextDecoder().decode(body);
|
|
2617
|
+
}
|
|
2618
|
+
__name(readResponseTextWithLimit, "readResponseTextWithLimit");
|
|
2619
|
+
async function resolveSecretsUrl(cwd) {
|
|
2620
|
+
try {
|
|
2621
|
+
const repoInfo = await getGitHubRepoInfoAsync({ cwd });
|
|
2622
|
+
return `https://github.com/${repoInfo.owner}/${repoInfo.repo}/settings/secrets/actions`;
|
|
2623
|
+
} catch {
|
|
2624
|
+
return void 0;
|
|
2625
|
+
}
|
|
2626
|
+
}
|
|
2627
|
+
__name(resolveSecretsUrl, "resolveSecretsUrl");
|
|
2628
|
+
async function realpathOrResolve(input) {
|
|
2629
|
+
try {
|
|
2630
|
+
return await fsp.realpath(input);
|
|
2631
|
+
} catch {
|
|
2632
|
+
return path.resolve(input);
|
|
2633
|
+
}
|
|
2634
|
+
}
|
|
2635
|
+
__name(realpathOrResolve, "realpathOrResolve");
|
|
2636
|
+
|
|
2637
|
+
// packages/cli/src/ui/utils/export/collect.ts
|
|
2638
|
+
init_esbuild_shims();
|
|
2639
|
+
import { randomUUID } from "node:crypto";
|
|
2640
|
+
|
|
2641
|
+
// packages/cli/src/utils/chat-record-tool-call-id.ts
|
|
2642
|
+
init_esbuild_shims();
|
|
2643
|
+
function getToolResultCallId(record) {
|
|
2644
|
+
return getExplicitToolResultCallId(record) ?? record.uuid;
|
|
2645
|
+
}
|
|
2646
|
+
__name(getToolResultCallId, "getToolResultCallId");
|
|
2647
|
+
function getExplicitToolResultCallId(record) {
|
|
2648
|
+
const resultCallId = record.toolCallResult?.callId;
|
|
2649
|
+
if (typeof resultCallId === "string" && resultCallId.length > 0) {
|
|
2650
|
+
return resultCallId;
|
|
2651
|
+
}
|
|
2652
|
+
return extractFunctionResponseId(record);
|
|
2653
|
+
}
|
|
2654
|
+
__name(getExplicitToolResultCallId, "getExplicitToolResultCallId");
|
|
2655
|
+
function extractFunctionResponseId(record) {
|
|
2656
|
+
if (!record.message?.parts) {
|
|
2657
|
+
return void 0;
|
|
2658
|
+
}
|
|
2659
|
+
for (const part of record.message.parts) {
|
|
2660
|
+
const id = "functionResponse" in part ? part.functionResponse?.id : void 0;
|
|
2661
|
+
if (typeof id === "string" && id.length > 0) {
|
|
2662
|
+
return id;
|
|
2663
|
+
}
|
|
2664
|
+
}
|
|
2665
|
+
return void 0;
|
|
2666
|
+
}
|
|
2667
|
+
__name(extractFunctionResponseId, "extractFunctionResponseId");
|
|
2668
|
+
|
|
2669
|
+
// packages/cli/src/ui/utils/export/collect.ts
|
|
2670
|
+
function extractToolNameFromRecord(record) {
|
|
2671
|
+
if (!record.message?.parts) {
|
|
2672
|
+
return void 0;
|
|
2673
|
+
}
|
|
2674
|
+
for (const part of record.message.parts) {
|
|
2675
|
+
if ("functionResponse" in part && part.functionResponse?.name) {
|
|
2676
|
+
return part.functionResponse.name;
|
|
2677
|
+
}
|
|
2678
|
+
}
|
|
2679
|
+
return void 0;
|
|
2680
|
+
}
|
|
2681
|
+
__name(extractToolNameFromRecord, "extractToolNameFromRecord");
|
|
2682
|
+
function normalizeFunctionCallArgs(args) {
|
|
2683
|
+
if (args && typeof args === "object") {
|
|
2684
|
+
return args;
|
|
2685
|
+
}
|
|
2686
|
+
if (typeof args === "string") {
|
|
2687
|
+
try {
|
|
2688
|
+
const parsed = JSON.parse(args);
|
|
2689
|
+
if (parsed && typeof parsed === "object") {
|
|
2690
|
+
return parsed;
|
|
2691
|
+
}
|
|
2692
|
+
} catch {
|
|
2693
|
+
}
|
|
2694
|
+
}
|
|
2695
|
+
return void 0;
|
|
2696
|
+
}
|
|
2697
|
+
__name(normalizeFunctionCallArgs, "normalizeFunctionCallArgs");
|
|
2698
|
+
function buildToolCallArgsIndex(records) {
|
|
2699
|
+
const byId = /* @__PURE__ */ new Map();
|
|
2700
|
+
const byName = /* @__PURE__ */ new Map();
|
|
2701
|
+
for (const record of records) {
|
|
2702
|
+
if (record.type !== "assistant" || !record.message?.parts) continue;
|
|
2703
|
+
for (const part of record.message.parts) {
|
|
2704
|
+
if (!("functionCall" in part) || !part.functionCall?.name) continue;
|
|
2705
|
+
const normalizedArgs = normalizeFunctionCallArgs(part.functionCall.args);
|
|
2706
|
+
if (!normalizedArgs) continue;
|
|
2707
|
+
const toolName = part.functionCall.name;
|
|
2708
|
+
const callId = typeof part.functionCall.id === "string" ? part.functionCall.id : null;
|
|
2709
|
+
if (callId) {
|
|
2710
|
+
byId.set(callId, normalizedArgs);
|
|
2711
|
+
}
|
|
2712
|
+
const queue = byName.get(toolName) ?? [];
|
|
2713
|
+
queue.push(normalizedArgs);
|
|
2714
|
+
byName.set(toolName, queue);
|
|
2715
|
+
}
|
|
2716
|
+
}
|
|
2717
|
+
return { byId, byName };
|
|
2718
|
+
}
|
|
2719
|
+
__name(buildToolCallArgsIndex, "buildToolCallArgsIndex");
|
|
2720
|
+
function calculateFileStats(records) {
|
|
2721
|
+
const argsIndex = buildToolCallArgsIndex(records);
|
|
2722
|
+
const byNameCursor = /* @__PURE__ */ new Map();
|
|
2723
|
+
const stats = {
|
|
2724
|
+
filesWritten: 0,
|
|
2725
|
+
linesAdded: 0,
|
|
2726
|
+
linesRemoved: 0,
|
|
2727
|
+
writtenFilePaths: /* @__PURE__ */ new Set()
|
|
2728
|
+
};
|
|
2729
|
+
for (const record of records) {
|
|
2730
|
+
if (record.type !== "tool_result" || !record.toolCallResult) continue;
|
|
2731
|
+
const toolName = extractToolNameFromRecord(record);
|
|
2732
|
+
const callId = getExplicitToolResultCallId(record);
|
|
2733
|
+
const argsFromId = callId && argsIndex.byId.has(callId) ? argsIndex.byId.get(callId) : void 0;
|
|
2734
|
+
let args = argsFromId;
|
|
2735
|
+
if (!args && toolName) {
|
|
2736
|
+
const queue = argsIndex.byName.get(toolName);
|
|
2737
|
+
if (queue && queue.length > 0) {
|
|
2738
|
+
const cursor = byNameCursor.get(toolName) ?? 0;
|
|
2739
|
+
args = queue[cursor];
|
|
2740
|
+
byNameCursor.set(toolName, cursor + 1);
|
|
2741
|
+
}
|
|
2742
|
+
}
|
|
2743
|
+
const { resultDisplay } = record.toolCallResult;
|
|
2744
|
+
if (resultDisplay && typeof resultDisplay === "object" && "fileName" in resultDisplay) {
|
|
2745
|
+
const display = resultDisplay;
|
|
2746
|
+
const hasOriginalContent = "originalContent" in display;
|
|
2747
|
+
const hasNewContent = "newContent" in display;
|
|
2748
|
+
let filePath;
|
|
2749
|
+
if (typeof display.fileName === "string") {
|
|
2750
|
+
filePath = args?.["file_path"] || display.fileName;
|
|
2751
|
+
} else {
|
|
2752
|
+
filePath = "unknown";
|
|
2753
|
+
}
|
|
2754
|
+
if (hasOriginalContent || hasNewContent) {
|
|
2755
|
+
stats.filesWritten++;
|
|
2756
|
+
stats.writtenFilePaths.add(filePath);
|
|
2757
|
+
if (display.diffStat) {
|
|
2758
|
+
stats.linesAdded += display.diffStat.model_added_lines ?? 0;
|
|
2759
|
+
stats.linesRemoved += display.diffStat.model_removed_lines ?? 0;
|
|
2760
|
+
} else if (!display.truncatedForSession) {
|
|
2761
|
+
const oldText = String(display.originalContent ?? "");
|
|
2762
|
+
const newText = String(display.newContent ?? "");
|
|
2763
|
+
const oldLines = oldText.split("\n").filter((line) => line.length > 0).length;
|
|
2764
|
+
const newLines = newText.split("\n").filter((line) => line.length > 0).length;
|
|
2765
|
+
stats.linesAdded += newLines;
|
|
2766
|
+
stats.linesRemoved += oldLines;
|
|
2767
|
+
}
|
|
2768
|
+
}
|
|
2769
|
+
}
|
|
2770
|
+
}
|
|
2771
|
+
return stats;
|
|
2772
|
+
}
|
|
2773
|
+
__name(calculateFileStats, "calculateFileStats");
|
|
2774
|
+
function extractTaskToolTokens(record) {
|
|
2775
|
+
if (record.type !== "tool_result" || !record.toolCallResult?.resultDisplay) {
|
|
2776
|
+
return 0;
|
|
2777
|
+
}
|
|
2778
|
+
const { resultDisplay } = record.toolCallResult;
|
|
2779
|
+
if (typeof resultDisplay === "object" && "type" in resultDisplay && resultDisplay.type === "task_execution" && "executionSummary" in resultDisplay) {
|
|
2780
|
+
const summary = resultDisplay.executionSummary;
|
|
2781
|
+
if (typeof summary.totalTokens === "number") {
|
|
2782
|
+
return summary.totalTokens;
|
|
2783
|
+
}
|
|
2784
|
+
return (summary.inputTokens ?? 0) + (summary.outputTokens ?? 0) + (summary.thoughtTokens ?? 0) + (summary.cachedTokens ?? 0);
|
|
2785
|
+
}
|
|
2786
|
+
return 0;
|
|
2787
|
+
}
|
|
2788
|
+
__name(extractTaskToolTokens, "extractTaskToolTokens");
|
|
2789
|
+
function calculateTokenStats(records) {
|
|
2790
|
+
let totalTokens = 0;
|
|
2791
|
+
let lastValidRecord = null;
|
|
2792
|
+
for (const record of records) {
|
|
2793
|
+
if (record.type === "assistant") {
|
|
2794
|
+
if (record.usageMetadata) {
|
|
2795
|
+
totalTokens += record.usageMetadata.totalTokenCount ?? 0;
|
|
2796
|
+
}
|
|
2797
|
+
if (record.usageMetadata?.totalTokenCount !== void 0 && record.contextWindowSize !== void 0) {
|
|
2798
|
+
lastValidRecord = {
|
|
2799
|
+
totalTokenCount: record.usageMetadata.totalTokenCount,
|
|
2800
|
+
contextWindowSize: record.contextWindowSize
|
|
2801
|
+
};
|
|
2802
|
+
}
|
|
2803
|
+
}
|
|
2804
|
+
const taskTokens = extractTaskToolTokens(record);
|
|
2805
|
+
if (taskTokens > 0) {
|
|
2806
|
+
totalTokens += taskTokens;
|
|
2807
|
+
}
|
|
2808
|
+
}
|
|
2809
|
+
if (lastValidRecord) {
|
|
2810
|
+
const percent = lastValidRecord.totalTokenCount / lastValidRecord.contextWindowSize * 100;
|
|
2811
|
+
return {
|
|
2812
|
+
totalTokens,
|
|
2813
|
+
contextUsagePercent: Math.round(percent * 10) / 10,
|
|
2814
|
+
contextWindowSize: lastValidRecord.contextWindowSize
|
|
2815
|
+
};
|
|
2816
|
+
}
|
|
2817
|
+
const lastAssistantRecord = [...records].reverse().find((r) => r.type === "assistant" && r.contextWindowSize !== void 0);
|
|
2818
|
+
return {
|
|
2819
|
+
totalTokens,
|
|
2820
|
+
contextWindowSize: lastAssistantRecord?.contextWindowSize
|
|
2821
|
+
};
|
|
2822
|
+
}
|
|
2823
|
+
__name(calculateTokenStats, "calculateTokenStats");
|
|
2824
|
+
function createExportSessionConfig(config) {
|
|
2825
|
+
const supportedConfig = {
|
|
2826
|
+
...config,
|
|
2827
|
+
getToolRegistry: /* @__PURE__ */ __name(() => {
|
|
2828
|
+
const registry = config.getToolRegistry?.();
|
|
2829
|
+
return {
|
|
2830
|
+
getTool: /* @__PURE__ */ __name((toolName) => registry?.getTool?.(toolName) ?? null, "getTool")
|
|
2831
|
+
};
|
|
2832
|
+
}, "getToolRegistry")
|
|
2833
|
+
};
|
|
2834
|
+
return new Proxy(supportedConfig, {
|
|
2835
|
+
get(target, prop, receiver) {
|
|
2836
|
+
if (prop in target) {
|
|
2837
|
+
return Reflect.get(target, prop, receiver);
|
|
2838
|
+
}
|
|
2839
|
+
if (typeof prop === "symbol") {
|
|
2840
|
+
return void 0;
|
|
2841
|
+
}
|
|
2842
|
+
throw new Error(
|
|
2843
|
+
`Export session replay config does not implement ${prop}`
|
|
2844
|
+
);
|
|
2845
|
+
}
|
|
2846
|
+
});
|
|
2847
|
+
}
|
|
2848
|
+
__name(createExportSessionConfig, "createExportSessionConfig");
|
|
2849
|
+
async function extractMetadata(conversation, config) {
|
|
2850
|
+
const { sessionId, startTime, messages } = conversation;
|
|
2851
|
+
const firstRecord = messages[0];
|
|
2852
|
+
const cwd = firstRecord?.cwd ?? "";
|
|
2853
|
+
const gitBranch = firstRecord?.gitBranch;
|
|
2854
|
+
let gitRepo;
|
|
2855
|
+
if (cwd) {
|
|
2856
|
+
const { getGitRepoName } = await import("./deferred-core-runtime-YQLHDUGE.js");
|
|
2857
|
+
gitRepo = getGitRepoName(cwd);
|
|
2858
|
+
}
|
|
2859
|
+
let model;
|
|
2860
|
+
for (const record of messages) {
|
|
2861
|
+
if (record.type === "assistant" && record.model) {
|
|
2862
|
+
model = record.model;
|
|
2863
|
+
break;
|
|
2864
|
+
}
|
|
2865
|
+
}
|
|
2866
|
+
const channel = config.getChannel?.();
|
|
2867
|
+
const promptCount = messages.filter((m) => m.type === "user").length;
|
|
2868
|
+
const fileStats = calculateFileStats(messages);
|
|
2869
|
+
const tokenStats = calculateTokenStats(messages);
|
|
2870
|
+
return {
|
|
2871
|
+
sessionId,
|
|
2872
|
+
startTime,
|
|
2873
|
+
exportTime: (/* @__PURE__ */ new Date()).toISOString(),
|
|
2874
|
+
cwd,
|
|
2875
|
+
gitRepo,
|
|
2876
|
+
gitBranch,
|
|
2877
|
+
model,
|
|
2878
|
+
channel,
|
|
2879
|
+
promptCount,
|
|
2880
|
+
contextUsagePercent: tokenStats.contextUsagePercent,
|
|
2881
|
+
contextWindowSize: tokenStats.contextWindowSize,
|
|
2882
|
+
totalTokens: tokenStats.totalTokens,
|
|
2883
|
+
filesWritten: fileStats.writtenFilePaths.size,
|
|
2884
|
+
linesAdded: fileStats.linesAdded,
|
|
2885
|
+
linesRemoved: fileStats.linesRemoved,
|
|
2886
|
+
uniqueFiles: Array.from(fileStats.writtenFilePaths)
|
|
2887
|
+
};
|
|
2888
|
+
}
|
|
2889
|
+
__name(extractMetadata, "extractMetadata");
|
|
2890
|
+
var ExportSessionContext = class {
|
|
2891
|
+
static {
|
|
2892
|
+
__name(this, "ExportSessionContext");
|
|
2893
|
+
}
|
|
2894
|
+
sessionId;
|
|
2895
|
+
config;
|
|
2896
|
+
messages = [];
|
|
2897
|
+
currentMessage = null;
|
|
2898
|
+
activeRecordId = null;
|
|
2899
|
+
activeRecordTimestamp = null;
|
|
2900
|
+
toolCallMap = /* @__PURE__ */ new Map();
|
|
2901
|
+
constructor(sessionId, config) {
|
|
2902
|
+
this.sessionId = sessionId;
|
|
2903
|
+
this.config = createExportSessionConfig(config);
|
|
2904
|
+
}
|
|
2905
|
+
async sendUpdate(update) {
|
|
2906
|
+
switch (update.sessionUpdate) {
|
|
2907
|
+
case "user_message_chunk":
|
|
2908
|
+
this.handleMessageChunk("user", update.content);
|
|
2909
|
+
break;
|
|
2910
|
+
case "agent_message_chunk": {
|
|
2911
|
+
const usageMeta = update._meta;
|
|
2912
|
+
const usageMetadata = usageMeta?.usage ? {
|
|
2913
|
+
promptTokenCount: usageMeta.usage.inputTokens,
|
|
2914
|
+
candidatesTokenCount: usageMeta.usage.outputTokens,
|
|
2915
|
+
totalTokenCount: usageMeta.usage.totalTokens,
|
|
2916
|
+
thoughtsTokenCount: usageMeta.usage.thoughtTokens,
|
|
2917
|
+
cachedContentTokenCount: usageMeta.usage.cachedReadTokens
|
|
2918
|
+
} : void 0;
|
|
2919
|
+
this.handleMessageChunk(
|
|
2920
|
+
"assistant",
|
|
2921
|
+
update.content,
|
|
2922
|
+
"assistant",
|
|
2923
|
+
usageMetadata
|
|
2924
|
+
);
|
|
2925
|
+
break;
|
|
2926
|
+
}
|
|
2927
|
+
case "agent_thought_chunk":
|
|
2928
|
+
this.handleMessageChunk("assistant", update.content, "thinking");
|
|
2929
|
+
break;
|
|
2930
|
+
case "tool_call":
|
|
2931
|
+
this.flushCurrentMessage();
|
|
2932
|
+
this.handleToolCallStart(update);
|
|
2933
|
+
break;
|
|
2934
|
+
case "tool_call_update":
|
|
2935
|
+
this.handleToolCallUpdate(update);
|
|
2936
|
+
break;
|
|
2937
|
+
case "plan":
|
|
2938
|
+
this.flushCurrentMessage();
|
|
2939
|
+
this.handlePlanUpdate(update);
|
|
2940
|
+
break;
|
|
2941
|
+
default:
|
|
2942
|
+
break;
|
|
2943
|
+
}
|
|
2944
|
+
}
|
|
2945
|
+
setActiveRecordId(recordId, timestamp) {
|
|
2946
|
+
this.activeRecordId = recordId;
|
|
2947
|
+
this.activeRecordTimestamp = timestamp ?? null;
|
|
2948
|
+
}
|
|
2949
|
+
getMessageTimestamp() {
|
|
2950
|
+
return this.activeRecordTimestamp ?? (/* @__PURE__ */ new Date()).toISOString();
|
|
2951
|
+
}
|
|
2952
|
+
getMessageUuid() {
|
|
2953
|
+
return this.activeRecordId ?? randomUUID();
|
|
2954
|
+
}
|
|
2955
|
+
handleMessageChunk(role, content, messageRole = role, usageMetadata) {
|
|
2956
|
+
if (content.type !== "text" || !content.text) return;
|
|
2957
|
+
if (this.currentMessage && (this.currentMessage.type !== role || this.currentMessage.role !== messageRole)) {
|
|
2958
|
+
this.flushCurrentMessage();
|
|
2959
|
+
}
|
|
2960
|
+
if (this.currentMessage && this.currentMessage.type === role && this.currentMessage.role === messageRole) {
|
|
2961
|
+
this.currentMessage.parts.push({ text: content.text });
|
|
2962
|
+
if (usageMetadata && role === "assistant") {
|
|
2963
|
+
this.currentMessage.usageMetadata = usageMetadata;
|
|
2964
|
+
}
|
|
2965
|
+
} else {
|
|
2966
|
+
this.currentMessage = {
|
|
2967
|
+
type: role,
|
|
2968
|
+
role: messageRole,
|
|
2969
|
+
parts: [{ text: content.text }],
|
|
2970
|
+
timestamp: Date.now(),
|
|
2971
|
+
...usageMetadata && role === "assistant" ? { usageMetadata } : {}
|
|
2972
|
+
};
|
|
2973
|
+
}
|
|
2974
|
+
}
|
|
2975
|
+
handleToolCallStart(update) {
|
|
2976
|
+
const toolCall = {
|
|
2977
|
+
toolCallId: update.toolCallId,
|
|
2978
|
+
kind: update.kind || "other",
|
|
2979
|
+
title: typeof update.title === "string" ? update.title : update.title || "",
|
|
2980
|
+
status: update.status || "pending",
|
|
2981
|
+
rawInput: update.rawInput,
|
|
2982
|
+
locations: update.locations,
|
|
2983
|
+
timestamp: Date.now()
|
|
2984
|
+
};
|
|
2985
|
+
this.toolCallMap.set(update.toolCallId, toolCall);
|
|
2986
|
+
const uuid = this.getMessageUuid();
|
|
2987
|
+
this.messages.push({
|
|
2988
|
+
uuid,
|
|
2989
|
+
sessionId: this.sessionId,
|
|
2990
|
+
timestamp: this.getMessageTimestamp(),
|
|
2991
|
+
type: "tool_call",
|
|
2992
|
+
toolCall
|
|
2993
|
+
});
|
|
2994
|
+
}
|
|
2995
|
+
handleToolCallUpdate(update) {
|
|
2996
|
+
const toolCall = this.toolCallMap.get(update.toolCallId);
|
|
2997
|
+
if (toolCall) {
|
|
2998
|
+
if (update.status) toolCall.status = update.status;
|
|
2999
|
+
if (update.content) toolCall.content = update.content;
|
|
3000
|
+
if (update.title)
|
|
3001
|
+
toolCall.title = typeof update.title === "string" ? update.title : "";
|
|
3002
|
+
}
|
|
3003
|
+
}
|
|
3004
|
+
handlePlanUpdate(update) {
|
|
3005
|
+
const uuid = this.getMessageUuid();
|
|
3006
|
+
const timestamp = this.getMessageTimestamp();
|
|
3007
|
+
const todoText = update.entries.map((entry) => {
|
|
3008
|
+
const checkbox = entry.status === "completed" ? "[x]" : entry.status === "in_progress" ? "[-]" : "[ ]";
|
|
3009
|
+
return `- ${checkbox} ${entry.content}`;
|
|
3010
|
+
}).join("\n");
|
|
3011
|
+
const todoContent = [
|
|
3012
|
+
{
|
|
3013
|
+
type: "content",
|
|
3014
|
+
content: {
|
|
3015
|
+
type: "text",
|
|
3016
|
+
text: todoText
|
|
3017
|
+
}
|
|
3018
|
+
}
|
|
3019
|
+
];
|
|
3020
|
+
this.messages.push({
|
|
3021
|
+
uuid,
|
|
3022
|
+
sessionId: this.sessionId,
|
|
3023
|
+
timestamp,
|
|
3024
|
+
type: "tool_call",
|
|
3025
|
+
toolCall: {
|
|
3026
|
+
toolCallId: uuid,
|
|
3027
|
+
// Use the same uuid as toolCallId for plan updates
|
|
3028
|
+
kind: "todowrite",
|
|
3029
|
+
title: "TodoList",
|
|
3030
|
+
status: "completed",
|
|
3031
|
+
content: todoContent,
|
|
3032
|
+
timestamp: Date.parse(timestamp)
|
|
3033
|
+
}
|
|
3034
|
+
});
|
|
3035
|
+
}
|
|
3036
|
+
flushCurrentMessage() {
|
|
3037
|
+
if (!this.currentMessage) return;
|
|
3038
|
+
const uuid = this.getMessageUuid();
|
|
3039
|
+
const exportMessage = {
|
|
3040
|
+
uuid,
|
|
3041
|
+
sessionId: this.sessionId,
|
|
3042
|
+
timestamp: this.getMessageTimestamp(),
|
|
3043
|
+
type: this.currentMessage.type,
|
|
3044
|
+
message: {
|
|
3045
|
+
role: this.currentMessage.role,
|
|
3046
|
+
parts: this.currentMessage.parts
|
|
3047
|
+
}
|
|
3048
|
+
};
|
|
3049
|
+
if (this.currentMessage.type === "assistant" && this.currentMessage.usageMetadata) {
|
|
3050
|
+
exportMessage.usageMetadata = this.currentMessage.usageMetadata;
|
|
3051
|
+
}
|
|
3052
|
+
this.messages.push(exportMessage);
|
|
3053
|
+
this.currentMessage = null;
|
|
3054
|
+
}
|
|
3055
|
+
flushMessages() {
|
|
3056
|
+
this.flushCurrentMessage();
|
|
3057
|
+
}
|
|
3058
|
+
getMessages() {
|
|
3059
|
+
return this.messages;
|
|
3060
|
+
}
|
|
3061
|
+
};
|
|
3062
|
+
async function collectSessionData(conversation, config) {
|
|
3063
|
+
const exportContext = new ExportSessionContext(
|
|
3064
|
+
conversation.sessionId,
|
|
3065
|
+
config
|
|
3066
|
+
);
|
|
3067
|
+
const replayer = new HistoryReplayer(exportContext);
|
|
3068
|
+
await replayer.replay(conversation.messages);
|
|
3069
|
+
exportContext.flushMessages();
|
|
3070
|
+
const messages = exportContext.getMessages();
|
|
3071
|
+
const metadata = await extractMetadata(conversation, config);
|
|
3072
|
+
return {
|
|
3073
|
+
sessionId: conversation.sessionId,
|
|
3074
|
+
startTime: conversation.startTime,
|
|
3075
|
+
messages,
|
|
3076
|
+
metadata
|
|
3077
|
+
};
|
|
3078
|
+
}
|
|
3079
|
+
__name(collectSessionData, "collectSessionData");
|
|
3080
|
+
|
|
3081
|
+
// packages/cli/src/ui/utils/export/normalize.ts
|
|
3082
|
+
init_esbuild_shims();
|
|
3083
|
+
|
|
3084
|
+
// packages/cli/src/utils/truncatedDiffPreview.ts
|
|
3085
|
+
init_esbuild_shims();
|
|
3086
|
+
function buildTruncatedDiffPreviewText2(display) {
|
|
3087
|
+
const fileName = typeof display["fileName"] === "string" ? display["fileName"] : "the edited file";
|
|
3088
|
+
const fileDiffLength = typeof display["fileDiffLength"] === "number" ? ` Original fileDiff length: ${display["fileDiffLength"]} chars.` : "";
|
|
3089
|
+
if (display["fileDiffTruncated"] === true) {
|
|
3090
|
+
return `Full diff omitted from saved session history for ${fileName}.${fileDiffLength}`;
|
|
3091
|
+
}
|
|
3092
|
+
return `Saved session preview only for ${fileName}; full original and new file contents are unavailable.`;
|
|
3093
|
+
}
|
|
3094
|
+
__name(buildTruncatedDiffPreviewText2, "buildTruncatedDiffPreviewText");
|
|
3095
|
+
|
|
3096
|
+
// packages/cli/src/ui/utils/export/normalize.ts
|
|
3097
|
+
function normalizeSessionData(sessionData, originalRecords, config) {
|
|
3098
|
+
const normalized = [...sessionData.messages];
|
|
3099
|
+
const toolCallIndexById = /* @__PURE__ */ new Map();
|
|
3100
|
+
normalized.forEach((message, index) => {
|
|
3101
|
+
if (message.type === "tool_call" && message.toolCall?.toolCallId) {
|
|
3102
|
+
toolCallIndexById.set(message.toolCall.toolCallId, index);
|
|
3103
|
+
}
|
|
3104
|
+
});
|
|
3105
|
+
const assistantMessageIndexByUuid = /* @__PURE__ */ new Map();
|
|
3106
|
+
normalized.forEach((message, index) => {
|
|
3107
|
+
if (message.type === "assistant") {
|
|
3108
|
+
assistantMessageIndexByUuid.set(message.uuid, index);
|
|
3109
|
+
}
|
|
3110
|
+
});
|
|
3111
|
+
for (const record of originalRecords) {
|
|
3112
|
+
if (record.type !== "tool_result") continue;
|
|
3113
|
+
const toolCallMessage = buildToolCallMessageFromResult(record, config);
|
|
3114
|
+
if (!toolCallMessage?.toolCall) continue;
|
|
3115
|
+
const existingIndex = toolCallIndexById.get(
|
|
3116
|
+
toolCallMessage.toolCall.toolCallId
|
|
3117
|
+
);
|
|
3118
|
+
if (existingIndex === void 0) {
|
|
3119
|
+
toolCallIndexById.set(
|
|
3120
|
+
toolCallMessage.toolCall.toolCallId,
|
|
3121
|
+
normalized.length
|
|
3122
|
+
);
|
|
3123
|
+
normalized.push(toolCallMessage);
|
|
3124
|
+
continue;
|
|
3125
|
+
}
|
|
3126
|
+
const existingMessage = normalized[existingIndex];
|
|
3127
|
+
if (existingMessage.type !== "tool_call" || !existingMessage.toolCall) {
|
|
3128
|
+
continue;
|
|
3129
|
+
}
|
|
3130
|
+
mergeToolCallData(existingMessage.toolCall, toolCallMessage.toolCall);
|
|
3131
|
+
}
|
|
3132
|
+
for (const record of originalRecords) {
|
|
3133
|
+
if (record.type !== "assistant") continue;
|
|
3134
|
+
if (!record.usageMetadata) continue;
|
|
3135
|
+
const existingIndex = assistantMessageIndexByUuid.get(record.uuid);
|
|
3136
|
+
if (existingIndex !== void 0) {
|
|
3137
|
+
if (!normalized[existingIndex].usageMetadata) {
|
|
3138
|
+
normalized[existingIndex].usageMetadata = record.usageMetadata;
|
|
3139
|
+
}
|
|
3140
|
+
}
|
|
3141
|
+
}
|
|
3142
|
+
return {
|
|
3143
|
+
...sessionData,
|
|
3144
|
+
messages: normalized
|
|
3145
|
+
};
|
|
3146
|
+
}
|
|
3147
|
+
__name(normalizeSessionData, "normalizeSessionData");
|
|
3148
|
+
function mergeToolCallData(existing, incoming) {
|
|
3149
|
+
if (!existing.content || existing.content.length === 0) {
|
|
3150
|
+
existing.content = incoming.content;
|
|
3151
|
+
}
|
|
3152
|
+
if (existing.status === "pending" || existing.status === "in_progress") {
|
|
3153
|
+
existing.status = incoming.status;
|
|
3154
|
+
}
|
|
3155
|
+
if (!existing.rawInput && incoming.rawInput) {
|
|
3156
|
+
existing.rawInput = incoming.rawInput;
|
|
3157
|
+
}
|
|
3158
|
+
if (!existing.kind || existing.kind === "other") {
|
|
3159
|
+
existing.kind = incoming.kind;
|
|
3160
|
+
}
|
|
3161
|
+
if ((!existing.title || existing.title === "") && incoming.title) {
|
|
3162
|
+
existing.title = incoming.title;
|
|
3163
|
+
}
|
|
3164
|
+
if ((!existing.locations || existing.locations.length === 0) && incoming.locations && incoming.locations.length > 0) {
|
|
3165
|
+
existing.locations = incoming.locations;
|
|
3166
|
+
}
|
|
3167
|
+
}
|
|
3168
|
+
__name(mergeToolCallData, "mergeToolCallData");
|
|
3169
|
+
function buildToolCallMessageFromResult(record, config) {
|
|
3170
|
+
const toolCallResult = record.toolCallResult;
|
|
3171
|
+
const toolName = extractToolNameFromRecord2(record);
|
|
3172
|
+
if (toolName === ToolNames.TODO_WRITE) {
|
|
3173
|
+
return null;
|
|
3174
|
+
}
|
|
3175
|
+
const toolCallId2 = getToolResultCallId(record);
|
|
3176
|
+
const functionCallArgs = extractFunctionCallArgs(record);
|
|
3177
|
+
const { kind, title, locations } = resolveToolMetadata(
|
|
3178
|
+
config,
|
|
3179
|
+
toolName,
|
|
3180
|
+
functionCallArgs ?? toolCallResult?.args
|
|
3181
|
+
);
|
|
3182
|
+
const rawInput = normalizeRawInput(
|
|
3183
|
+
functionCallArgs ?? toolCallResult?.args
|
|
3184
|
+
);
|
|
3185
|
+
const resultContent = extractDiffContent2(toolCallResult?.resultDisplay) ?? transformPartsToToolCallContent(record.message?.parts ?? []);
|
|
3186
|
+
const content = isVisionBridgeNoticeDisplay(toolCallResult?.resultDisplay) ? [
|
|
3187
|
+
{
|
|
3188
|
+
type: "content",
|
|
3189
|
+
content: {
|
|
3190
|
+
type: "text",
|
|
3191
|
+
text: sanitizeTerminalText(
|
|
3192
|
+
formatVisionBridgeNoticeDisplay(toolCallResult.resultDisplay)
|
|
3193
|
+
)
|
|
3194
|
+
}
|
|
3195
|
+
},
|
|
3196
|
+
...resultContent
|
|
3197
|
+
] : resultContent;
|
|
3198
|
+
return {
|
|
3199
|
+
uuid: record.uuid,
|
|
3200
|
+
parentUuid: record.parentUuid,
|
|
3201
|
+
sessionId: record.sessionId,
|
|
3202
|
+
timestamp: record.timestamp,
|
|
3203
|
+
type: "tool_call",
|
|
3204
|
+
toolCall: {
|
|
3205
|
+
toolCallId: toolCallId2,
|
|
3206
|
+
kind,
|
|
3207
|
+
title,
|
|
3208
|
+
status: toolCallResult?.error ? "failed" : "completed",
|
|
3209
|
+
rawInput,
|
|
3210
|
+
content,
|
|
3211
|
+
locations,
|
|
3212
|
+
timestamp: Date.parse(record.timestamp)
|
|
3213
|
+
}
|
|
3214
|
+
};
|
|
3215
|
+
}
|
|
3216
|
+
__name(buildToolCallMessageFromResult, "buildToolCallMessageFromResult");
|
|
3217
|
+
function extractToolNameFromRecord2(record) {
|
|
3218
|
+
if (!record.message?.parts) {
|
|
3219
|
+
return "";
|
|
3220
|
+
}
|
|
3221
|
+
for (const part of record.message.parts) {
|
|
3222
|
+
if ("functionResponse" in part && part.functionResponse?.name) {
|
|
3223
|
+
return part.functionResponse.name;
|
|
3224
|
+
}
|
|
3225
|
+
}
|
|
3226
|
+
return "";
|
|
3227
|
+
}
|
|
3228
|
+
__name(extractToolNameFromRecord2, "extractToolNameFromRecord");
|
|
3229
|
+
function extractFunctionCallArgs(record) {
|
|
3230
|
+
if (!record.message?.parts) {
|
|
3231
|
+
return void 0;
|
|
3232
|
+
}
|
|
3233
|
+
for (const part of record.message.parts) {
|
|
3234
|
+
if ("functionCall" in part && part.functionCall?.args) {
|
|
3235
|
+
return part.functionCall.args;
|
|
3236
|
+
}
|
|
3237
|
+
}
|
|
3238
|
+
return void 0;
|
|
3239
|
+
}
|
|
3240
|
+
__name(extractFunctionCallArgs, "extractFunctionCallArgs");
|
|
3241
|
+
function resolveToolMetadata(config, toolName, args) {
|
|
3242
|
+
const toolRegistry = config.getToolRegistry?.();
|
|
3243
|
+
const tool = toolName ? toolRegistry?.getTool?.(toolName) : void 0;
|
|
3244
|
+
let title = tool?.displayName ?? toolName ?? "tool_call";
|
|
3245
|
+
let locations;
|
|
3246
|
+
const kind = mapToolKind(tool?.kind, toolName);
|
|
3247
|
+
if (tool?.build && args) {
|
|
3248
|
+
try {
|
|
3249
|
+
const invocation = tool.build(args);
|
|
3250
|
+
title = `${title}: ${invocation.getDescription()}`;
|
|
3251
|
+
locations = invocation.toolLocations().map((loc) => ({
|
|
3252
|
+
path: loc.path,
|
|
3253
|
+
line: loc.line ?? null
|
|
3254
|
+
}));
|
|
3255
|
+
} catch {
|
|
3256
|
+
}
|
|
3257
|
+
}
|
|
3258
|
+
return { kind, title, locations };
|
|
3259
|
+
}
|
|
3260
|
+
__name(resolveToolMetadata, "resolveToolMetadata");
|
|
3261
|
+
function mapToolKind(kind, toolName) {
|
|
3262
|
+
if (toolName && (toolName === ToolNames.EXIT_PLAN_MODE || toolName === ToolNames.ENTER_PLAN_MODE)) {
|
|
3263
|
+
return "switch_mode";
|
|
3264
|
+
}
|
|
3265
|
+
if (toolName && toolName === ToolNames.TODO_WRITE) {
|
|
3266
|
+
return "todowrite";
|
|
3267
|
+
}
|
|
3268
|
+
const allowedKinds = /* @__PURE__ */ new Set([
|
|
3269
|
+
"read",
|
|
3270
|
+
"edit",
|
|
3271
|
+
"delete",
|
|
3272
|
+
"move",
|
|
3273
|
+
"search",
|
|
3274
|
+
"execute",
|
|
3275
|
+
"think",
|
|
3276
|
+
"fetch",
|
|
3277
|
+
"other"
|
|
3278
|
+
]);
|
|
3279
|
+
if (kind && allowedKinds.has(kind)) {
|
|
3280
|
+
return kind;
|
|
3281
|
+
}
|
|
3282
|
+
return "other";
|
|
3283
|
+
}
|
|
3284
|
+
__name(mapToolKind, "mapToolKind");
|
|
3285
|
+
function extractDiffContent2(resultDisplay) {
|
|
3286
|
+
if (!resultDisplay || typeof resultDisplay !== "object") {
|
|
3287
|
+
return null;
|
|
3288
|
+
}
|
|
3289
|
+
const display = resultDisplay;
|
|
3290
|
+
if ("fileName" in display && "newContent" in display) {
|
|
3291
|
+
if (display["truncatedForSession"] === true) {
|
|
3292
|
+
return [
|
|
3293
|
+
{
|
|
3294
|
+
type: "content",
|
|
3295
|
+
content: {
|
|
3296
|
+
type: "text",
|
|
3297
|
+
text: buildTruncatedDiffPreviewText2(display)
|
|
3298
|
+
}
|
|
3299
|
+
}
|
|
3300
|
+
];
|
|
3301
|
+
}
|
|
3302
|
+
return [
|
|
3303
|
+
{
|
|
3304
|
+
type: "diff",
|
|
3305
|
+
path: display["fileName"],
|
|
3306
|
+
oldText: display["originalContent"] ?? "",
|
|
3307
|
+
newText: display["newContent"]
|
|
3308
|
+
}
|
|
3309
|
+
];
|
|
3310
|
+
}
|
|
3311
|
+
return null;
|
|
3312
|
+
}
|
|
3313
|
+
__name(extractDiffContent2, "extractDiffContent");
|
|
3314
|
+
function normalizeRawInput(value) {
|
|
3315
|
+
if (typeof value === "string") return value;
|
|
3316
|
+
if (typeof value === "object" && value !== null) return value;
|
|
3317
|
+
return void 0;
|
|
3318
|
+
}
|
|
3319
|
+
__name(normalizeRawInput, "normalizeRawInput");
|
|
3320
|
+
function transformPartsToToolCallContent(parts) {
|
|
3321
|
+
const content = [];
|
|
3322
|
+
for (const part of parts) {
|
|
3323
|
+
if ("text" in part && part.text) {
|
|
3324
|
+
content.push({
|
|
3325
|
+
type: "content",
|
|
3326
|
+
content: { type: "text", text: part.text }
|
|
3327
|
+
});
|
|
3328
|
+
continue;
|
|
3329
|
+
}
|
|
3330
|
+
if ("functionResponse" in part && part.functionResponse) {
|
|
3331
|
+
const response = part.functionResponse.response;
|
|
3332
|
+
const outputField = response?.["output"];
|
|
3333
|
+
const errorField = response?.["error"];
|
|
3334
|
+
const responseText = typeof outputField === "string" ? outputField : typeof errorField === "string" ? errorField : JSON.stringify(response);
|
|
3335
|
+
content.push({
|
|
3336
|
+
type: "content",
|
|
3337
|
+
content: { type: "text", text: responseText }
|
|
3338
|
+
});
|
|
3339
|
+
}
|
|
3340
|
+
}
|
|
3341
|
+
return content;
|
|
3342
|
+
}
|
|
3343
|
+
__name(transformPartsToToolCallContent, "transformPartsToToolCallContent");
|
|
3344
|
+
|
|
3345
|
+
// packages/cli/src/ui/utils/export/formatters/markdown.ts
|
|
3346
|
+
init_esbuild_shims();
|
|
3347
|
+
function toMarkdown(sessionData) {
|
|
3348
|
+
const lines = [];
|
|
3349
|
+
const metadata = sessionData.metadata;
|
|
3350
|
+
lines.push("# Chat Session Export\n");
|
|
3351
|
+
lines.push(`- **Session ID**: \`${sanitizeText(sessionData.sessionId)}\``);
|
|
3352
|
+
lines.push(`- **Start Time**: ${sanitizeText(sessionData.startTime)}`);
|
|
3353
|
+
lines.push(
|
|
3354
|
+
`- **Exported**: ${sanitizeText(metadata?.exportTime ?? (/* @__PURE__ */ new Date()).toISOString())}`
|
|
3355
|
+
);
|
|
3356
|
+
lines.push("");
|
|
3357
|
+
if (metadata?.cwd) {
|
|
3358
|
+
lines.push(`- **Working Directory**: \`${sanitizeText(metadata.cwd)}\``);
|
|
3359
|
+
}
|
|
3360
|
+
if (metadata?.gitRepo) {
|
|
3361
|
+
lines.push(`- **Git Repository**: ${sanitizeText(metadata.gitRepo)}`);
|
|
3362
|
+
}
|
|
3363
|
+
if (metadata?.gitBranch) {
|
|
3364
|
+
lines.push(`- **Git Branch**: \`${sanitizeText(metadata.gitBranch)}\``);
|
|
3365
|
+
}
|
|
3366
|
+
lines.push("");
|
|
3367
|
+
if (metadata?.model) {
|
|
3368
|
+
lines.push(`- **Model**: ${sanitizeText(metadata.model)}`);
|
|
3369
|
+
}
|
|
3370
|
+
if (metadata?.channel) {
|
|
3371
|
+
lines.push(`- **Channel**: ${sanitizeText(metadata.channel)}`);
|
|
3372
|
+
}
|
|
3373
|
+
if (metadata?.promptCount !== void 0) {
|
|
3374
|
+
lines.push(`- **Prompt Count**: ${metadata.promptCount}`);
|
|
3375
|
+
}
|
|
3376
|
+
lines.push("");
|
|
3377
|
+
if (metadata?.totalTokens !== void 0) {
|
|
3378
|
+
lines.push(`- **Total Tokens**: ${metadata.totalTokens}`);
|
|
3379
|
+
}
|
|
3380
|
+
if (metadata?.contextWindowSize !== void 0) {
|
|
3381
|
+
lines.push(`- **Context Window Size**: ${metadata.contextWindowSize}`);
|
|
3382
|
+
}
|
|
3383
|
+
if (metadata?.contextUsagePercent !== void 0) {
|
|
3384
|
+
lines.push(`- **Context Usage**: ${metadata.contextUsagePercent}%`);
|
|
3385
|
+
}
|
|
3386
|
+
lines.push("");
|
|
3387
|
+
if (metadata?.filesWritten !== void 0) {
|
|
3388
|
+
lines.push(`- **Files Written**: ${metadata.filesWritten}`);
|
|
3389
|
+
}
|
|
3390
|
+
if (metadata?.linesAdded !== void 0) {
|
|
3391
|
+
lines.push(`- **Lines Added**: ${metadata.linesAdded}`);
|
|
3392
|
+
}
|
|
3393
|
+
if (metadata?.linesRemoved !== void 0) {
|
|
3394
|
+
lines.push(`- **Lines Removed**: ${metadata.linesRemoved}`);
|
|
3395
|
+
}
|
|
3396
|
+
if (metadata?.uniqueFiles && metadata.uniqueFiles.length > 0) {
|
|
3397
|
+
lines.push("");
|
|
3398
|
+
lines.push("<details>");
|
|
3399
|
+
lines.push(
|
|
3400
|
+
`<summary><strong>Unique Files Referenced (${metadata.uniqueFiles.length})</strong></summary>`
|
|
3401
|
+
);
|
|
3402
|
+
lines.push("");
|
|
3403
|
+
for (const file of metadata.uniqueFiles) {
|
|
3404
|
+
lines.push(`- \`${sanitizeText(file)}\``);
|
|
3405
|
+
}
|
|
3406
|
+
lines.push("</details>");
|
|
3407
|
+
}
|
|
3408
|
+
lines.push("\n---\n");
|
|
3409
|
+
for (const message of sessionData.messages) {
|
|
3410
|
+
if (message.type === "user") {
|
|
3411
|
+
lines.push("## User\n");
|
|
3412
|
+
lines.push(formatMessageContent(message));
|
|
3413
|
+
} else if (message.type === "assistant") {
|
|
3414
|
+
lines.push("## Assistant\n");
|
|
3415
|
+
lines.push(formatMessageContent(message));
|
|
3416
|
+
} else if (message.type === "tool_call") {
|
|
3417
|
+
lines.push(formatToolCall(message));
|
|
3418
|
+
} else if (message.type === "system") {
|
|
3419
|
+
lines.push("### System\n");
|
|
3420
|
+
const text = formatMessageContent(message);
|
|
3421
|
+
lines.push(`> ${text.replace(/\n/g, "\n> ")}`);
|
|
3422
|
+
}
|
|
3423
|
+
lines.push("\n");
|
|
3424
|
+
}
|
|
3425
|
+
return lines.join("\n");
|
|
3426
|
+
}
|
|
3427
|
+
__name(toMarkdown, "toMarkdown");
|
|
3428
|
+
function formatMessageContent(message) {
|
|
3429
|
+
const text = extractTextFromMessage(message);
|
|
3430
|
+
const processedText = text.replace(
|
|
3431
|
+
/--- Content from referenced files ---\n([\s\S]*?)\n--- End of content ---/g,
|
|
3432
|
+
(match, content) => `
|
|
3433
|
+
> **Referenced Files:**
|
|
3434
|
+
|
|
3435
|
+
${createCodeBlock(content)}
|
|
3436
|
+
`
|
|
3437
|
+
);
|
|
3438
|
+
return processedText;
|
|
3439
|
+
}
|
|
3440
|
+
__name(formatMessageContent, "formatMessageContent");
|
|
3441
|
+
function formatToolCall(message) {
|
|
3442
|
+
if (!message.toolCall) return "";
|
|
3443
|
+
const lines = [];
|
|
3444
|
+
const { title, status, rawInput, content, locations } = message.toolCall;
|
|
3445
|
+
const titleStr = typeof title === "string" ? title : JSON.stringify(title);
|
|
3446
|
+
lines.push(`### Tool: ${sanitizeText(titleStr)}`);
|
|
3447
|
+
lines.push(`**Status**: ${sanitizeText(status)}
|
|
3448
|
+
`);
|
|
3449
|
+
if (rawInput) {
|
|
3450
|
+
lines.push("**Input:**");
|
|
3451
|
+
const inputStr = typeof rawInput === "string" ? rawInput : JSON.stringify(rawInput, null, 2);
|
|
3452
|
+
lines.push(createCodeBlock(inputStr, "json"));
|
|
3453
|
+
lines.push("");
|
|
3454
|
+
}
|
|
3455
|
+
if (locations && locations.length > 0) {
|
|
3456
|
+
lines.push("**Affected Files:**");
|
|
3457
|
+
for (const loc of locations) {
|
|
3458
|
+
const lineSuffix = loc.line ? `:${loc.line}` : "";
|
|
3459
|
+
lines.push(`- \`${sanitizeText(loc.path)}${lineSuffix}\``);
|
|
3460
|
+
}
|
|
3461
|
+
lines.push("");
|
|
3462
|
+
}
|
|
3463
|
+
if (content && content.length > 0) {
|
|
3464
|
+
lines.push("**Output:**");
|
|
3465
|
+
for (const item of content) {
|
|
3466
|
+
if (item.type === "content" && item["content"]) {
|
|
3467
|
+
const contentData = item["content"];
|
|
3468
|
+
if (contentData.type === "text" && contentData.text) {
|
|
3469
|
+
let language = "";
|
|
3470
|
+
if (locations && locations.length === 1 && locations[0].path) {
|
|
3471
|
+
language = getLanguageFromPath(locations[0].path);
|
|
3472
|
+
}
|
|
3473
|
+
lines.push(createCodeBlock(contentData.text, language));
|
|
3474
|
+
}
|
|
3475
|
+
} else if (item.type === "diff") {
|
|
3476
|
+
const path2 = item["path"];
|
|
3477
|
+
const diffText = item["newText"];
|
|
3478
|
+
lines.push(`
|
|
3479
|
+
*Diff for \`${sanitizeText(path2)}\`:*`);
|
|
3480
|
+
lines.push(createCodeBlock(diffText, "diff"));
|
|
3481
|
+
}
|
|
3482
|
+
}
|
|
3483
|
+
}
|
|
3484
|
+
return lines.join("\n");
|
|
3485
|
+
}
|
|
3486
|
+
__name(formatToolCall, "formatToolCall");
|
|
3487
|
+
function extractTextFromMessage(message) {
|
|
3488
|
+
if (!message.message?.parts) return "";
|
|
3489
|
+
const textParts = [];
|
|
3490
|
+
for (const part of message.message.parts) {
|
|
3491
|
+
if ("text" in part) {
|
|
3492
|
+
textParts.push(part.text);
|
|
3493
|
+
}
|
|
3494
|
+
}
|
|
3495
|
+
return textParts.join("\n");
|
|
3496
|
+
}
|
|
3497
|
+
__name(extractTextFromMessage, "extractTextFromMessage");
|
|
3498
|
+
function createCodeBlock(content, language = "") {
|
|
3499
|
+
const fence = buildFence(content);
|
|
3500
|
+
return `${fence}${language}
|
|
3501
|
+
${content}
|
|
3502
|
+
${fence}`;
|
|
3503
|
+
}
|
|
3504
|
+
__name(createCodeBlock, "createCodeBlock");
|
|
3505
|
+
function sanitizeText(value) {
|
|
3506
|
+
return (value ?? "").replace(/&/g, "&").replace(/</g, "<");
|
|
3507
|
+
}
|
|
3508
|
+
__name(sanitizeText, "sanitizeText");
|
|
3509
|
+
function buildFence(value) {
|
|
3510
|
+
const matches = (value ?? "").match(/`+/g);
|
|
3511
|
+
const maxRun = matches ? Math.max(...matches.map((match) => match.length)) : 0;
|
|
3512
|
+
const fenceLength = Math.max(3, maxRun + 1);
|
|
3513
|
+
return "`".repeat(fenceLength);
|
|
3514
|
+
}
|
|
3515
|
+
__name(buildFence, "buildFence");
|
|
3516
|
+
function getLanguageFromPath(path2) {
|
|
3517
|
+
const ext = path2.split(".").pop()?.toLowerCase();
|
|
3518
|
+
switch (ext) {
|
|
3519
|
+
case "ts":
|
|
3520
|
+
case "tsx":
|
|
3521
|
+
return "typescript";
|
|
3522
|
+
case "js":
|
|
3523
|
+
case "jsx":
|
|
3524
|
+
case "mjs":
|
|
3525
|
+
case "cjs":
|
|
3526
|
+
return "javascript";
|
|
3527
|
+
case "py":
|
|
3528
|
+
return "python";
|
|
3529
|
+
case "rb":
|
|
3530
|
+
return "ruby";
|
|
3531
|
+
case "go":
|
|
3532
|
+
return "go";
|
|
3533
|
+
case "rs":
|
|
3534
|
+
return "rust";
|
|
3535
|
+
case "java":
|
|
3536
|
+
return "java";
|
|
3537
|
+
case "c":
|
|
3538
|
+
case "cpp":
|
|
3539
|
+
case "h":
|
|
3540
|
+
case "hpp":
|
|
3541
|
+
return "cpp";
|
|
3542
|
+
case "cs":
|
|
3543
|
+
return "csharp";
|
|
3544
|
+
case "html":
|
|
3545
|
+
return "html";
|
|
3546
|
+
case "css":
|
|
3547
|
+
return "css";
|
|
3548
|
+
case "json":
|
|
3549
|
+
return "json";
|
|
3550
|
+
case "md":
|
|
3551
|
+
return "markdown";
|
|
3552
|
+
case "sh":
|
|
3553
|
+
case "bash":
|
|
3554
|
+
case "zsh":
|
|
3555
|
+
return "bash";
|
|
3556
|
+
case "yaml":
|
|
3557
|
+
case "yml":
|
|
3558
|
+
return "yaml";
|
|
3559
|
+
case "xml":
|
|
3560
|
+
return "xml";
|
|
3561
|
+
case "sql":
|
|
3562
|
+
return "sql";
|
|
3563
|
+
default:
|
|
3564
|
+
return "";
|
|
3565
|
+
}
|
|
3566
|
+
}
|
|
3567
|
+
__name(getLanguageFromPath, "getLanguageFromPath");
|
|
3568
|
+
|
|
3569
|
+
// packages/cli/src/ui/utils/export/formatters/html.ts
|
|
3570
|
+
init_esbuild_shims();
|
|
3571
|
+
|
|
3572
|
+
// packages/web-templates/src/index.ts
|
|
3573
|
+
init_esbuild_shims();
|
|
3574
|
+
|
|
3575
|
+
// packages/web-templates/src/generated/insightTemplate.ts
|
|
3576
|
+
init_esbuild_shims();
|
|
3577
|
+
var INSIGHT_JS = '(function(e,O){"use strict";function J({data:t}){const{totalMessages:n=0,totalLinesAdded:l=0,totalLinesRemoved:r=0,totalFiles:a=0}=t,s=Object.keys(t.heatmap||{});let o=0;if(s.length>0){const c=s.map(x=>new Date(x)).map(x=>x.getTime()),d=new Date(Math.min(...c)),g=new Date(Math.max(...c)),E=Math.abs(g.getTime()-d.getTime());o=Math.ceil(E/(1e3*60*60*24))+1}const i=o>0?Math.round(n/o):0;return e.createElement("div",{className:"stats-row"},e.createElement("div",{className:"stat"},e.createElement("div",{className:"stat-value"},n),e.createElement("div",{className:"stat-label"},"Messages")),e.createElement("div",{className:"stat"},e.createElement("div",{className:"stat-value"},"+",l,"/-",r),e.createElement("div",{className:"stat-label"},"Lines")),e.createElement("div",{className:"stat"},e.createElement("div",{className:"stat-value"},a),e.createElement("div",{className:"stat-label"},"Files")),e.createElement("div",{className:"stat"},e.createElement("div",{className:"stat-value"},o),e.createElement("div",{className:"stat-label"},"Days")),e.createElement("div",{className:"stat"},e.createElement("div",{className:"stat-value"},i),e.createElement("div",{className:"stat-label"},"Msgs/Day")))}/**\n * @license\n * Copyright 2026 Qwen Team\n * SPDX-License-Identifier: Apache-2.0\n */function D(t){const n=t.getFullYear(),l=String(t.getMonth()+1).padStart(2,"0"),r=String(t.getDate()).padStart(2,"0");return`${n}-${l}-${r}`}function Y(t){const[n,l,r]=t.split("-").map(Number);return new Date(n,l-1,r)}function V({insights:t}){return e.createElement("div",{className:"grid gap-4 md:grid-cols-2 md:gap-6"},e.createElement(X,{activeHours:t.activeHours,cardClass:"glass-card p-6",sectionTitleClass:"text-lg font-semibold tracking-tight text-slate-900"}))}function X({activeHours:t,cardClass:n,sectionTitleClass:l}){const a=[{label:"Morning",time:"06:00 - 12:00",hours:[6,7,8,9,10,11],color:"#fbbf24"},{label:"Afternoon",time:"12:00 - 18:00",hours:[12,13,14,15,16,17],color:"#0ea5e9"},{label:"Evening",time:"18:00 - 22:00",hours:[18,19,20,21],color:"#6366f1"},{label:"Night",time:"22:00 - 06:00",hours:[22,23,0,1,2,3,4,5],color:"#475569"}].map(o=>{const i=o.hours.reduce((m,c)=>m+(t[c]||0),0);return{...o,total:i}}),s=Math.max(...a.map(o=>o.total));return e.createElement("div",{className:`${n} h-full flex flex-col min-h-[320px]`},e.createElement("div",{className:"flex items-center justify-between mb-4"},e.createElement("h3",{className:l},"Active Hours")),e.createElement("div",{className:"flex-1 flex flex-col justify-center gap-4"},a.map(o=>e.createElement("div",{key:o.label,className:"space-y-2"},e.createElement("div",{className:"flex justify-between items-center text-sm"},e.createElement("div",{className:"flex items-center gap-2"},e.createElement("span",{className:"rounded-full",style:{width:"12px",height:"12px",backgroundColor:o.color}}),e.createElement("span",{className:"font-medium text-slate-700"},o.label),e.createElement("span",{className:"text-xs text-slate-400 hidden xl:inline"},o.time)),e.createElement("span",{className:"font-semibold text-slate-900"},o.total)),e.createElement("div",{className:"w-full rounded-full overflow-hidden",style:{height:"12px",backgroundColor:"#e2e8f0"}},e.createElement("div",{className:"h-full rounded-full",style:{width:`${s>0?o.total/s*100:0}%`,backgroundColor:o.color}}))))))}function Z({heatmap:t}){return e.createElement("div",{className:"glass-card p-6 mt-4 md:mt-6"},e.createElement("div",{className:"mb-3"},e.createElement("h3",{className:"text-lg font-semibold tracking-tight text-slate-900"},"Activity Heatmap"),e.createElement("p",{className:"text-xs text-slate-500"},"Showing past year of activity")),e.createElement("div",{className:"heatmap-container"},e.createElement("div",{className:"min-w-[720px] rounded-xl bg-white/70"},e.createElement(R,{heatmapData:t}))),e.createElement(ee,null))}function R({heatmapData:t}){const s=new Date,o=new Date(s);o.setFullYear(s.getFullYear()-1);const i=[],m=new Date(o);for(;m<=s;)i.push(new Date(m)),m.setDate(m.getDate()+1);const c=[0,2,4,10,20],d=["#ebedf0","#9be9a8","#40c463","#30a14e","#216e39"];function g(u){if(u===0)return d[0];for(let f=c.length-1;f>=1;f--)if(u>=c[f])return d[f];return d[1]}const E=50,x=20,A=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],w=o.getDay(),j=[];let h=-1,T=-100;return i.forEach((u,f)=>{const C=f+w,_=Math.floor(C/7),v=E+_*16,N=u.getMonth();N!==h&&(v-T>30&&(j.push({x:v,text:A[N]}),T=v),h=N)}),e.createElement("svg",{className:"heatmap-svg",width:1e3,height:130,viewBox:"0 0 1000 130"},i.map((u,f)=>{const C=f+w,_=Math.floor(C/7),v=u.getDay(),N=E+_*16,q=x+v*16,k=D(u),S=t[k]||0,I=g(S);return e.createElement("rect",{key:k,className:"heatmap-day",x:N,y:q,width:14,height:14,rx:"2",fill:I,"data-date":k,"data-count":S},e.createElement("title",null,k,": ",S," activities"))}),j.map((u,f)=>e.createElement("text",{key:f,x:u.x,y:"15",fontSize:"12",fill:"#64748b"},u.text)))}function ee(){const t=["#ebedf0","#9be9a8","#40c463","#30a14e","#216e39"];return e.createElement("div",{className:"flex items-center gap-2 mt-4"},e.createElement("span",{className:"text-xs text-slate-500"},"Less"),t.map((n,l)=>e.createElement("span",{key:l,className:"inline-block rounded",style:{width:"10px",height:"10px",backgroundColor:n}})),e.createElement("span",{className:"text-xs text-slate-500"},"More"))}function p({children:t}){if(!t||typeof t!="string")return t;const n=t.split(/(\\*\\*.*?\\*\\*)/g);return e.createElement(e.Fragment,null,n.map((l,r)=>l.startsWith("**")&&l.endsWith("**")&&l.length>=4?e.createElement("strong",{key:r},l.slice(2,-2)):l))}function H({text:t,label:n="Copy"}){const[l,r]=e.useState(!1),a=()=>{navigator.clipboard.writeText(t).then(()=>{r(!0),setTimeout(()=>r(!1),2e3)})};return e.createElement("button",{className:"copy-btn",onClick:a},l?"Copied!":n)}function te(t){return typeof t=="string"&&t.trim().length>0}function ne({qualitative:t,targetSections:n}){const{atAGlance:l}=t;if(!l)return null;const r=[{key:"wins",label:"What\'s working:",body:l.whats_working,href:"#section-wins",link:"Impressive Things You Did \u2192",showLink:n.wins},{key:"friction",label:"What\'s hindering you:",body:l.whats_hindering,href:"#section-friction",link:"Where Things Go Wrong \u2192",showLink:n.friction},{key:"features",label:"Quick wins to try:",body:l.quick_wins,href:"#section-features",link:"Features to Try \u2192",showLink:n.features},{key:"horizon",label:"Ambitious workflows:",body:l.ambitious_workflows,href:"#section-horizon",link:"On the Horizon \u2192",showLink:n.horizon}].filter(a=>te(a.body));return r.length===0?null:e.createElement("div",{className:"at-a-glance"},e.createElement("div",{className:"glance-title"},"At a Glance"),e.createElement("div",{className:"glance-sections"},r.map(a=>e.createElement("div",{key:a.key,className:"glance-section"},e.createElement("strong",null,a.label)," ",e.createElement(p,null,a.body),a.showLink&&e.createElement("a",{href:a.href,className:"see-more"},a.link)))))}function le({sections:t}){return t.length===0?null:e.createElement("nav",{className:"nav-toc"},t.map(n=>e.createElement("a",{key:n.href,href:n.href},n.label)))}function re({qualitative:t,topGoals:n,topTools:l}){const{projectAreas:r}=t,a=Array.isArray(l)?Object.fromEntries(l):l;return e.createElement(e.Fragment,null,e.createElement("h2",{id:"section-work",className:"text-xl font-semibold text-slate-900 mt-8 mb-4"},"What You Work On"),Array.isArray(r==null?void 0:r.areas)&&r.areas.length>0&&e.createElement("div",{className:"project-areas mb-6"},r.areas.map((s,o)=>e.createElement("div",{key:o,className:"project-area"},e.createElement("div",{className:"area-header"},e.createElement("span",{className:"area-name"},s.name),e.createElement("span",{className:"area-count"},"~",s.session_count," sessions")),e.createElement("div",{className:"area-desc"},e.createElement(p,null,s.description))))),e.createElement("div",{style:{display:"grid",gridTemplateColumns:"repeat(2, 1fr)",gap:"24px",marginBottom:"24px"}},n&&Object.keys(n).length>0&&e.createElement(M,{data:n,title:"What You Wanted",color:"#0ea5e9"}),a&&Object.keys(a).length>0&&e.createElement(M,{data:a,title:"Top Tools Used",color:"#6366f1"})))}function ae({qualitative:t,insights:n}){const{interactionStyle:l}=t;return l?e.createElement(e.Fragment,null,e.createElement("h2",{id:"section-usage",className:"text-xl font-semibold text-slate-900 mt-8 mb-4"},"How You Use Qwen Code"),e.createElement("div",{className:"narrative"},e.createElement("p",null,e.createElement(p,null,l.narrative)),l.key_pattern&&e.createElement("div",{className:"key-insight"},e.createElement("strong",null,"Key pattern:")," ",e.createElement(p,null,l.key_pattern))),e.createElement(V,{insights:n}),e.createElement(Z,{heatmap:n.heatmap})):null}function se({qualitative:t,primarySuccess:n,outcomes:l}){const r=t==null?void 0:t.impressiveWorkflows;return e.createElement(e.Fragment,null,e.createElement("h2",{id:"section-wins",className:"text-xl font-semibold text-slate-900 mt-8 mb-4"},"Impressive Things You Did"),(r==null?void 0:r.intro)&&e.createElement("p",{className:"section-intro"},e.createElement(p,null,r.intro)),r&&e.createElement("div",{className:"big-wins"},Array.isArray(r.impressive_workflows)&&r.impressive_workflows.map((a,s)=>e.createElement("div",{key:s,className:"big-win"},e.createElement("div",{className:"big-win-title"},a.title),e.createElement("div",{className:"big-win-desc"},e.createElement(p,null,a.description))))),e.createElement("div",{style:{display:"grid",gridTemplateColumns:"repeat(2, 1fr)",gap:"24px",marginTop:"24px",marginBottom:"24px"}},n&&Object.keys(n).length>0&&e.createElement(M,{data:n,title:"What Helped Most (Qwen\'s Capabilities)",color:"#3b82f6",allowedKeys:["fast_accurate_search","correct_code_edits","good_explanations","proactive_help","multi_file_changes","good_debugging"]}),l&&Object.keys(l).length>0&&e.createElement(M,{data:l,title:"Outcomes",color:"#8b5cf6",allowedKeys:["fully_achieved","mostly_achieved","partially_achieved","not_achieved","unclear_from_transcript"]})))}function oe(t){return t==="unclear_from_transcript"?"Unclear":t.split("_").map(n=>n.charAt(0).toUpperCase()+n.slice(1)).join(" ")}function M({data:t,title:n,color:l="#3b82f6",allowedKeys:r=null}){if(!t||Object.keys(t).length===0)return null;let a=Object.entries(t).filter(([,o])=>Number.isFinite(o)&&o!==0);if(r&&(a=a.filter(([o])=>r.includes(o))),a.sort((o,i)=>i[1]-o[1]),a=a.slice(0,10),a.length===0)return null;const s=Math.max(...a.map(([,o])=>o));return e.createElement("div",{className:"bar-chart-card",style:{flex:1,minWidth:0,backgroundColor:"#ffffff",borderRadius:"12px",padding:"20px",boxShadow:"0 1px 3px rgba(0, 0, 0, 0.08)",border:"1px solid #e2e8f0"}},e.createElement("h3",{style:{fontSize:"13px",fontWeight:700,color:"#64748b",marginTop:0,marginBottom:"16px",textTransform:"uppercase",letterSpacing:"0.5px"}},n),e.createElement("div",{className:"bar-chart",style:{display:"flex",flexDirection:"column",gap:"10px"}},a.map(([o,i])=>{const m=s>0?i/s*100:0;return e.createElement("div",{key:o,className:"bar-row",style:{display:"flex",alignItems:"center",gap:"12px"}},e.createElement("div",{className:"bar-label",style:{width:"130px",fontSize:"13px",color:"#475569",textAlign:"left",flexShrink:0,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}},oe(o)),e.createElement("div",{className:"bar-wrapper",style:{flex:1,display:"flex",alignItems:"center",gap:"10px",minWidth:0}},e.createElement("div",{className:"bar-bg",style:{flex:1,height:"8px",backgroundColor:"#f1f5f9",borderRadius:"4px",overflow:"hidden"}},e.createElement("div",{className:"bar-fill",style:{width:`${m}%`,height:"100%",backgroundColor:l,borderRadius:"4px",transition:"width 0.3s ease"}})),e.createElement("span",{className:"bar-value",style:{fontSize:"13px",fontWeight:600,color:"#475569",minWidth:"24px",textAlign:"right"}},i)))})))}function ie({qualitative:t,satisfaction:n,friction:l}){const r=t==null?void 0:t.frictionPoints;return e.createElement(e.Fragment,null,e.createElement("h2",{id:"section-friction",className:"text-xl font-semibold text-slate-900 mt-8 mb-4"},"Where Things Go Wrong"),(r==null?void 0:r.intro)&&e.createElement("p",{className:"section-intro"},e.createElement(p,null,r.intro)),r&&e.createElement("div",{className:"friction-categories"},Array.isArray(r.categories)&&r.categories.map((a,s)=>e.createElement("div",{key:s,className:"friction-category"},e.createElement("div",{className:"friction-title"},a.category),e.createElement("div",{className:"friction-desc"},e.createElement(p,null,a.description)),Array.isArray(a.examples)&&a.examples.length>0&&e.createElement("ul",{className:"friction-examples"},a.examples.map((o,i)=>e.createElement("li",{key:i},e.createElement(p,null,o))))))),e.createElement("div",{style:{display:"grid",gridTemplateColumns:"repeat(2, 1fr)",gap:"24px",marginTop:"24px",marginBottom:"24px"}},l&&Object.keys(l).length>0&&e.createElement(M,{data:l,title:"Primary Friction Types",color:"#ef4444",allowedKeys:["misunderstood_request","wrong_approach","buggy_code","user_rejected_action","excessive_changes"]}),n&&Object.keys(n).length>0&&e.createElement(M,{data:n,title:"Inferred Satisfaction (model-estimated)",color:"#10b981",allowedKeys:["happy","satisfied","likely_satisfied","dissatisfied","frustrated"]})))}function me({additions:t}){const[n,l]=e.useState(new Array(t.length).fill(!0)),[r,a]=e.useState(!1),s=m=>{const c=n.map((d,g)=>g===m?!d:d);l(c)},o=()=>{const m=t.filter((c,d)=>n[d]).map(c=>c.addition).join(`\n\n`);m&&navigator.clipboard.writeText(m).then(()=>{a(!0),setTimeout(()=>a(!1),2e3)})},i=n.filter(Boolean).length;return e.createElement("div",{className:"qwen-md-section"},e.createElement("h3",null,"Suggested QWEN.md Additions"),e.createElement("p",{className:"text-xs text-slate-500 mb-3"},"Just copy this into Qwen Code to add it to your QWEN.md."),e.createElement("div",{className:"qwen-md-actions",style:{marginBottom:"12px"}},e.createElement("button",{className:`copy-all-btn ${r?"copied":""}`,onClick:o,disabled:i===0},r?"Copied All!":`Copy All Checked (${i})`)),t.map((m,c)=>e.createElement("div",{key:c,className:"qwen-md-item"},e.createElement("input",{type:"checkbox",checked:n[c],onChange:()=>s(c),className:"cmd-checkbox"}),e.createElement("div",{style:{flex:1}},e.createElement("code",{className:"cmd-code"},m.addition),e.createElement("div",{className:"cmd-why"},e.createElement(p,null,m.why))),e.createElement(H,{text:m.addition}))))}function ce({qualitative:t}){const{improvements:n}=t;if(!n)return null;const l=Array.isArray(n.Qwen_md_additions)&&n.Qwen_md_additions.length>0||Array.isArray(n.features_to_try)&&n.features_to_try.length>0,r=Array.isArray(n.usage_patterns)&&n.usage_patterns.length>0;return!l&&!r?null:e.createElement(e.Fragment,null,l&&e.createElement(e.Fragment,null,e.createElement("h2",{id:"section-features",className:"text-xl font-semibold text-slate-900 mt-8 mb-4"},"Existing Qwen Code Features to Try"),Array.isArray(n.Qwen_md_additions)&&n.Qwen_md_additions.length>0&&e.createElement(me,{additions:n.Qwen_md_additions}),e.createElement("p",{className:"text-xs text-slate-500 mb-3"},"Just copy this into Qwen Code and it\'ll set it up for you."),e.createElement("div",{className:"features-section"},Array.isArray(n.features_to_try)&&n.features_to_try.map((a,s)=>e.createElement("div",{key:s,className:"feature-card"},e.createElement("div",{className:"feature-title"},a.feature),e.createElement("div",{className:"feature-oneliner"},e.createElement(p,null,a.one_liner)),e.createElement("div",{className:"feature-why"},e.createElement("strong",null,"Why for you:")," ",e.createElement(p,null,a.why_for_you)),e.createElement("div",{className:"feature-examples"},e.createElement("div",{className:"feature-example"},e.createElement("div",{className:"example-code-row"},e.createElement("code",{className:"example-code"},a.example_code),e.createElement(H,{text:a.example_code})))))))),r&&e.createElement(e.Fragment,null,e.createElement("h2",{id:"section-patterns",className:"text-xl font-semibold text-slate-900 mt-8 mb-4"},"New Ways to Use Qwen Code"),e.createElement("p",{className:"text-xs text-slate-500 mb-3"},"Just copy this into Qwen Code and it\'ll walk you through it."),e.createElement("div",{className:"patterns-section"},Array.isArray(n.usage_patterns)&&n.usage_patterns.map((a,s)=>e.createElement("div",{key:s,className:"pattern-card"},e.createElement("div",{className:"pattern-title"},a.title),e.createElement("div",{className:"pattern-summary"},e.createElement(p,null,a.suggestion)),e.createElement("div",{className:"pattern-detail"},e.createElement(p,null,a.detail)),e.createElement("div",{className:"copyable-prompt-section"},e.createElement("div",{className:"prompt-label"},"Paste into Qwen Code:"),e.createElement("div",{className:"copyable-prompt-row"},e.createElement("code",{className:"copyable-prompt"},a.copyable_prompt),e.createElement(H,{text:a.copyable_prompt}))))))))}function de({qualitative:t}){const{futureOpportunities:n}=t;return n?e.createElement(e.Fragment,null,e.createElement("h2",{id:"section-horizon",className:"text-xl font-semibold text-slate-900 mt-8 mb-4"},"On the Horizon"),n.intro&&e.createElement("p",{className:"section-intro"},e.createElement(p,null,n.intro)),e.createElement("div",{className:"horizon-section"},Array.isArray(n.opportunities)&&n.opportunities.map((l,r)=>e.createElement("div",{key:r,className:"horizon-card"},e.createElement("div",{className:"horizon-title"},l.title),e.createElement("div",{className:"horizon-possible"},e.createElement(p,null,l.whats_possible)),e.createElement("div",{className:"horizon-tip"},e.createElement("strong",null,"Getting started:")," ",e.createElement(p,null,l.how_to_try)),e.createElement("div",{className:"pattern-prompt"},e.createElement("div",{className:"prompt-label"},"Paste into Qwen Code:"),e.createElement("div",{style:{display:"flex",alignItems:"flex-start",gap:"8px"}},e.createElement("code",{style:{flex:1}},l.copyable_prompt),e.createElement(H,{text:l.copyable_prompt}))))))):null}function pe({qualitative:t}){const{memorableMoment:n}=t;return n?e.createElement("div",{className:"fun-ending"},e.createElement("div",{className:"fun-headline"},\'"\',n.headline,\'"\'),e.createElement("div",{className:"fun-detail"},e.createElement(p,null,n.detail))):null}const ue={light:{background:"linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%)",textPrimary:"#0f172a",textSecondary:"#475569",textMuted:"#64748b",cardBackground:"rgba(255,255,255,0.7)",cardBackgroundSecondary:"rgba(255,255,255,0.5)",borderColor:"#e2e8f0",heatmapColors:["#9be9a8","#40c463","#30a14e","#216e39"],heatmapEmpty:"#ebedf0"},dark:{background:"linear-gradient(135deg, #0f172a 0%, #1e293b 100%)",textPrimary:"#f8fafc",textSecondary:"#e2e8f0",textMuted:"#94a3b8",cardBackground:"rgba(255,255,255,0.05)",cardBackgroundSecondary:"rgba(255,255,255,0.04)",borderColor:"rgba(255,255,255,0.08)",heatmapColors:["#0e4429","#006d32","#26a641","#39d353"],heatmapEmpty:"#2d333b"}};function fe({data:t,theme:n="light"}){var h,T,u,f,C,_;const l=ue[n],{totalMessages:r=0,totalSessions:a=0,totalLinesAdded:s=0,totalLinesRemoved:o=0,totalFiles:i=0,currentStreak:m=0,longestStreak:c=0,activeHours:d={}}=t,g=Object.keys(t.heatmap||{});let E=0,x="";if(g.length>0){E=g.length;const v=g.map(S=>Y(S).getTime()),N=new Date(Math.min(...v)),q=new Date(Math.max(...v)),k=S=>D(S);x=`${k(N)} \u2014 ${k(q)}`}const A=(u=(T=(h=t.qualitative)==null?void 0:h.interactionStyle)==null?void 0:T.key_pattern)!=null?u:null,w=(_=(C=(f=t.qualitative)==null?void 0:f.memorableMoment)==null?void 0:C.headline)!=null?_:null,j=ge(t.heatmap||{},l);return e.createElement("div",{id:"share-card",style:{width:"1200px",background:l.background,color:l.textPrimary,fontFamily:\'ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji"\',display:"flex",flexDirection:"column",padding:"48px 56px",position:"absolute",left:"-9999px",top:"-9999px",overflow:"hidden",boxSizing:"border-box"}},e.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",marginBottom:"32px"}},e.createElement("div",null,e.createElement("div",{style:{fontSize:"32px",fontWeight:700,letterSpacing:"-0.02em",lineHeight:1.2}},"Qwen Code Insights"),e.createElement("div",{style:{fontSize:"14px",color:l.textMuted,marginTop:"6px"}},x)),e.createElement("div",{style:{fontSize:"11px",color:l.textMuted,textTransform:"uppercase",letterSpacing:"0.15em",paddingTop:"8px"}},"qwen.ai")),e.createElement("div",{style:{display:"grid",gridTemplateColumns:"repeat(6, 1fr)",gap:"16px",marginBottom:"32px"}},e.createElement(z,{value:String(r),label:"Messages",theme:l}),e.createElement(z,{value:String(a),label:"Sessions",theme:l}),e.createElement(z,{value:`+${s}/-${o}`,label:"Lines Changed",small:!0,theme:l}),e.createElement(z,{value:String(i),label:"Files",theme:l}),e.createElement(z,{value:`${m}d`,label:"Streak",theme:l}),e.createElement(z,{value:`${c}d`,label:"Best Streak",theme:l})),e.createElement("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"24px",marginBottom:"16px"}},e.createElement("div",{style:{background:l.cardBackground,borderRadius:"12px",padding:"20px",display:"flex",flexDirection:"column"}},e.createElement("div",{style:{fontSize:"12px",fontWeight:600,color:l.textMuted,textTransform:"uppercase",letterSpacing:"0.08em",marginBottom:"12px"}},"Activity \xB7 ",E," active days"),e.createElement("div",{style:{flex:1,display:"flex",alignItems:"center",justifyContent:"center"}},e.createElement(xe,{cells:j})),e.createElement(Ee,{theme:l})),e.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"16px"}},e.createElement("div",{style:{background:l.cardBackground,borderRadius:"12px",padding:"20px",display:"flex",flexDirection:"column"}},e.createElement("div",{style:{fontSize:"12px",fontWeight:600,color:l.textMuted,textTransform:"uppercase",letterSpacing:"0.08em",marginBottom:"12px"}},"Active Hours"),e.createElement("div",{style:{flex:1,display:"flex",flexDirection:"column",justifyContent:"center",gap:"10px"}},e.createElement(he,{activeHours:d,theme:l}))),e.createElement("div",{style:{background:l.cardBackgroundSecondary,borderRadius:"12px",padding:"16px 16px",position:"relative"}},e.createElement("div",{style:{position:"absolute",left:"12px",fontSize:"64px",fontWeight:700,color:n==="light"?"rgba(99,102,241,0.15)":"rgba(99,102,241,0.2)",lineHeight:1,fontFamily:\'Georgia, "Times New Roman", serif\',userSelect:"none",pointerEvents:"none"}},"\u201C"),e.createElement("div",{style:{paddingLeft:"40px",position:"relative"}},A&&e.createElement("div",{style:{fontSize:"13px",color:l.textSecondary,lineHeight:1.6,marginBottom:w?"8px":0}},A),w&&e.createElement("div",{style:{fontSize:"12px",color:l.textMuted,lineHeight:1.5,fontStyle:"italic"}},w))))),e.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginTop:"auto",paddingTop:"24px",borderTop:`1px solid ${l.borderColor}`,flexShrink:0}},e.createElement("div",{style:{fontSize:"12px",color:l.textMuted}},"Generated by Qwen Code \xB7 ",D(new Date)),e.createElement("div",{style:{fontSize:"12px",color:l.textMuted}},"github.com/QwenLM/qwen-code")))}function z({value:t,label:n,small:l,theme:r}){return e.createElement("div",{style:{textAlign:"center"}},e.createElement("div",{style:{fontSize:l?"18px":"28px",fontWeight:700,color:r.textPrimary,lineHeight:1.2}},t),e.createElement("div",{style:{fontSize:"11px",color:r.textMuted,textTransform:"uppercase",letterSpacing:"0.05em",marginTop:"4px"}},n))}function he({activeHours:t,theme:n}){const r=[{label:"Morning",time:"06\u201312",hours:[6,7,8,9,10,11],color:"#fbbf24"},{label:"Afternoon",time:"12\u201318",hours:[12,13,14,15,16,17],color:"#0ea5e9"},{label:"Evening",time:"18\u201322",hours:[18,19,20,21],color:"#6366f1"},{label:"Night",time:"22\u201306",hours:[22,23,0,1,2,3,4,5],color:"#475569"}].map(s=>({...s,total:s.hours.reduce((o,i)=>o+(t[i]||0),0)})),a=Math.max(...r.map(s=>s.total),1);return e.createElement(e.Fragment,null,r.map(s=>{const o=a>0?s.total/a*100:0;return e.createElement("div",{key:s.label},e.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",fontSize:"12px",marginBottom:"4px"}},e.createElement("div",{style:{display:"flex",alignItems:"center",gap:"6px"}},e.createElement("span",{style:{width:"8px",height:"8px",borderRadius:"50%",backgroundColor:s.color,display:"inline-block",flexShrink:0}}),e.createElement("span",{style:{color:n.textSecondary,fontWeight:500}},s.label),e.createElement("span",{style:{color:n.textMuted,fontSize:"11px"}},s.time)),e.createElement("span",{style:{color:n.textMuted,fontWeight:600}},s.total)),e.createElement("div",{style:{height:"6px",background:n.borderColor,borderRadius:"3px",overflow:"hidden"}},e.createElement("div",{style:{width:`${o}%`,height:"100%",backgroundColor:s.color,borderRadius:"3px"}})))}))}function ge(t,n){const l=new Date,a=26*7,s=new Date(l);s.setDate(s.getDate()-a+1),s.setDate(s.getDate()-s.getDay());const o=[],i=new Date(l);i.setDate(i.getDate()+(6-i.getDay()));const m=new Date(s);for(;m<=i;){const c=D(m),d=t[c]||0;o.push({color:ye(d,n)}),m.setDate(m.getDate()+1)}return o}function ye(t,n){return t===0?n.heatmapEmpty:t<2?n.heatmapColors[0]:t<4?n.heatmapColors[1]:t<10?n.heatmapColors[2]:n.heatmapColors[3]}function xe({cells:t}){const l=Math.ceil(t.length/7),r=14,a=3,s=l*(r+a),o=7*(r+a);return e.createElement("svg",{width:s,height:o,viewBox:`0 0 ${s} ${o}`},t.map((i,m)=>{const c=Math.floor(m/7),d=m%7;return e.createElement("rect",{key:m,x:c*(r+a),y:d*(r+a),width:r,height:r,rx:2,fill:i.color})}))}function Ee({theme:t}){return e.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px",marginTop:"12px"}},e.createElement("span",{style:{fontSize:"11px",color:t.textMuted}},"Less"),[t.heatmapEmpty,t.heatmapColors[0],t.heatmapColors[1],t.heatmapColors[2],t.heatmapColors[3]].map((n,l)=>e.createElement("span",{key:l,style:{width:"10px",height:"10px",borderRadius:"2px",backgroundColor:n,display:"inline-block"}})),e.createElement("span",{style:{fontSize:"11px",color:t.textMuted}},"More"))}function b(t){return typeof t=="string"?t.trim().length>0:typeof t=="number"?Number.isFinite(t)&&t!==0:typeof t=="boolean"?t:Array.isArray(t)?t.some(n=>b(n)):t&&typeof t=="object"?Object.values(t).some(n=>b(n)):!1}function W(t){return Array.isArray(t)?t.some(([,n])=>Number.isFinite(n)&&n!==0):!!t&&Object.values(t).some(n=>Number.isFinite(n)&&n!==0)}function $(t){return Array.isArray(t)&&t.some(n=>b(n))}function ve({data:t}){var u,f,C,_,v,N,q,k,S,I,K,U;const[n,l]=e.useState("dark"),r=e.useRef(!1),a=async()=>{const F=document.getElementById("share-card");if(!F||!window.html2canvas){alert("Export functionality is not available.");return}try{const y=F.cloneNode(!0);y.style.position="fixed",y.style.left="-9999px",y.style.top="0",y.style.pointerEvents="none",document.body.appendChild(y);const P=await window.html2canvas(y,{scale:2,useCORS:!0,logging:!1,width:1200,height:y.scrollHeight});document.body.removeChild(y);const G=P.toDataURL("image/png"),L=document.createElement("a");L.href=G,L.download=`qwen-insights-card-${D(new Date)}.png`,L.click()}catch(y){console.error("Export card error:",y),alert("Failed to export card. Please try again.")}};e.useEffect(()=>{r.current&&(r.current=!1,a())},[n]);const s=F=>{F===n?a():(r.current=!0,l(F))};if(!t)return e.createElement("div",{className:"text-center text-slate-600"},"No insight data available");const o=Object.keys(t.heatmap||{});let i="";if(o.length>0){const y=o.map(B=>Y(B)).map(B=>B.getTime()),P=new Date(Math.min(...y)),G=new Date(Math.max(...y)),L=B=>D(B);i=`${L(P)} to ${L(G)}`}const m=b((u=t.qualitative)==null?void 0:u.atAGlance),c=!!t.qualitative&&(b(t.qualitative.projectAreas)||W(t.topGoals)||W(t.topTools)),d=b((f=t.qualitative)==null?void 0:f.interactionStyle),g=!!t.qualitative&&(b(t.qualitative.impressiveWorkflows)||W(t.primarySuccess)||W(t.outcomes)),E=!!t.qualitative&&(b(t.qualitative.frictionPoints)||W(t.satisfaction)||W(t.friction)),x=!!t.qualitative&&($((C=t.qualitative.improvements)==null?void 0:C.Qwen_md_additions)||$((_=t.qualitative.improvements)==null?void 0:_.features_to_try)),A=!!t.qualitative&&$((v=t.qualitative.improvements)==null?void 0:v.usage_patterns),w=b((N=t.qualitative)==null?void 0:N.futureOpportunities),j=b((q=t.qualitative)==null?void 0:q.memorableMoment),h=[];c&&h.push({href:"#section-work",label:"What You Work On"}),d&&h.push({href:"#section-usage",label:"How You Use Qwen Code"}),g&&h.push({href:"#section-wins",label:"Impressive Things"}),E&&h.push({href:"#section-friction",label:"Where Things Go Wrong"}),x&&h.push({href:"#section-features",label:"Features to Try"}),A&&h.push({href:"#section-patterns",label:"New Usage Patterns"}),w&&h.push({href:"#section-horizon",label:"On the Horizon"});const T={wins:g,friction:E,features:x,horizon:w};return e.createElement("div",null,e.createElement("header",{className:"insights-header"},e.createElement("div",{className:"header-content"},e.createElement("div",{className:"header-title-section"},e.createElement("h1",{className:"header-title"},"Qwen Code Insights"),e.createElement("p",{className:"header-subtitle"},t.totalMessages?`${t.totalMessages.toLocaleString()} messages across ${(k=t.totalSessions)==null?void 0:k.toLocaleString()} sessions`:"Your personalized coding journey and patterns",i&&` \xB7 ${i}`)),e.createElement(be,{onExport:s}))),m&&t.qualitative&&e.createElement(ne,{qualitative:t.qualitative,targetSections:T}),h.length>0&&e.createElement(le,{sections:h}),e.createElement(J,{data:t}),c&&t.qualitative&&e.createElement(re,{qualitative:t.qualitative,topGoals:t.topGoals,topTools:t.topTools}),d&&t.qualitative&&e.createElement(ae,{qualitative:t.qualitative,insights:t}),g&&e.createElement(se,{qualitative:t.qualitative,primarySuccess:(S=t.primarySuccess)!=null?S:{},outcomes:(I=t.outcomes)!=null?I:{}}),E&&e.createElement(ie,{qualitative:t.qualitative,satisfaction:(K=t.satisfaction)!=null?K:{},friction:(U=t.friction)!=null?U:{}}),(x||A)&&t.qualitative&&e.createElement(ce,{qualitative:t.qualitative}),w&&t.qualitative&&e.createElement(de,{qualitative:t.qualitative}),j&&t.qualitative&&e.createElement(pe,{qualitative:t.qualitative}),e.createElement(fe,{data:t,theme:n}))}function be({onExport:t}){const[n,l]=e.useState(!1),r=e.useRef(null);e.useEffect(()=>{if(!n)return;const s=o=>{r.current&&!r.current.contains(o.target)&&l(!1)};return document.addEventListener("mousedown",s),()=>document.removeEventListener("mousedown",s)},[n]);const a=s=>{l(!1),t(s)};return e.createElement("div",{className:"export-dropdown-wrapper",ref:r},e.createElement("button",{className:"export-card-btn",onClick:()=>l(!n)},e.createElement("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},e.createElement("path",{d:"M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8"}),e.createElement("polyline",{points:"16 6 12 2 8 6"}),e.createElement("line",{x1:"12",y1:"2",x2:"12",y2:"15"})),e.createElement("span",null,"Export Card"),e.createElement("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:`export-chevron ${n?"open":""}`},e.createElement("polyline",{points:"6 9 12 15 18 9"}))),n&&e.createElement("div",{className:"export-dropdown"},e.createElement("button",{className:"export-dropdown-item",onClick:()=>a("light")},e.createElement("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},e.createElement("circle",{cx:"12",cy:"12",r:"5"}),e.createElement("line",{x1:"12",y1:"1",x2:"12",y2:"3"}),e.createElement("line",{x1:"12",y1:"21",x2:"12",y2:"23"}),e.createElement("line",{x1:"4.22",y1:"4.22",x2:"5.64",y2:"5.64"}),e.createElement("line",{x1:"18.36",y1:"18.36",x2:"19.78",y2:"19.78"}),e.createElement("line",{x1:"1",y1:"12",x2:"3",y2:"12"}),e.createElement("line",{x1:"21",y1:"12",x2:"23",y2:"12"}),e.createElement("line",{x1:"4.22",y1:"19.78",x2:"5.64",y2:"18.36"}),e.createElement("line",{x1:"18.36",y1:"5.64",x2:"19.78",y2:"4.22"})),e.createElement("span",null,"Light Theme")),e.createElement("button",{className:"export-dropdown-item",onClick:()=>a("dark")},e.createElement("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},e.createElement("path",{d:"M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"})),e.createElement("span",null,"Dark Theme"))))}const Q=document.getElementById("react-root");Q&&window.INSIGHT_DATA&&O?O.createRoot(Q).render(e.createElement(ve,{data:window.INSIGHT_DATA})):console.error("Failed to mount React app:",{container:!!Q,data:!!window.INSIGHT_DATA,ReactDOM:!!O})})(React,ReactDOM);';
|
|
3578
|
+
var INSIGHT_CSS = '*,:before,:after,::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: #3b82f680;--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border:0 solid #e5e7eb}:before,:after{--tw-content: ""}html,:host{-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";line-height:1.5}body{line-height:inherit;margin:0;background-image:linear-gradient(to bottom right,var(--tw-gradient-stops));--tw-gradient-from: #f8fafc var(--tw-gradient-from-position);--tw-gradient-to: #f1f5f9 var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), #fff var(--tw-gradient-via-position), var(--tw-gradient-to);--tw-text-opacity: 1;min-height:100vh;color:rgb(15 23 42 / var(--tw-text-opacity, 1));-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.glass-card{--tw-border-opacity: 1;border-width:1px;border-color:rgb(226 232 240 / var(--tw-border-opacity, 1));--tw-shadow: 0 10px 40px #0f172a14;--tw-shadow-colored: 0 10px 40px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow);--tw-backdrop-blur: blur(8px);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);background-color:#fff9;border-radius:1rem}.col-span-2{grid-column:span 2 / span 2}.mx-auto{margin-left:auto;margin-right:auto}.mb-8{margin-bottom:2rem}.ml-2{margin-left:.5rem}.mt-1{margin-top:.25rem}.mt-2{margin-top:.5rem}.mt-4{margin-top:1rem}.mt-6{margin-top:1.5rem}.block{display:block}.flex{display:flex}.inline-flex{display:inline-flex}.grid{display:grid}.h-56{height:14rem}.h-full{height:100%}.min-h-screen{min-height:100vh}.w-full{width:100%}.min-w-\\[720px\\]{min-width:720px}.max-w-6xl{max-width:72rem}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.flex-col{flex-direction:column}.items-start{align-items:flex-start}.items-center{align-items:center}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.divide-y>:not([hidden])~:not([hidden]){--tw-divide-y-reverse: 0;border-top-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)));border-bottom-width:calc(1px * var(--tw-divide-y-reverse))}.divide-slate-200>:not([hidden])~:not([hidden]){--tw-divide-opacity: 1;border-color:rgb(226 232 240 / var(--tw-divide-opacity, 1))}.overflow-x-auto{overflow-x:auto}.rounded-full{border-radius:9999px}.rounded-xl{border-radius:1.25rem}.border{border-width:1px}.border-slate-100{--tw-border-opacity: 1;border-color:rgb(241 245 249 / var(--tw-border-opacity, 1))}.bg-emerald-50{--tw-bg-opacity: 1;background-color:rgb(236 253 245 / var(--tw-bg-opacity, 1))}.bg-slate-100{--tw-bg-opacity: 1;background-color:rgb(241 245 249 / var(--tw-bg-opacity, 1))}.bg-slate-50{--tw-bg-opacity: 1;background-color:rgb(248 250 252 / var(--tw-bg-opacity, 1))}.bg-slate-900{--tw-bg-opacity: 1;background-color:rgb(15 23 42 / var(--tw-bg-opacity, 1))}.bg-white\\/70{background-color:#ffffff73}.bg-gradient-to-br{background-image:linear-gradient(to bottom right,var(--tw-gradient-stops))}.from-slate-50{--tw-gradient-from: #f8fafc var(--tw-gradient-from-position);--tw-gradient-to: #f8fafc00 var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.via-white{--tw-gradient-to: #ffffff00 var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), #ffffff var(--tw-gradient-via-position), var(--tw-gradient-to)}.to-slate-100{--tw-gradient-to: #f1f5f9 var(--tw-gradient-to-position)}.p-4{padding:1rem}.p-6{padding:1.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-5{padding-left:1.25rem;padding-right:1.25rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.px-8{padding-left:2rem;padding-right:2rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-10{padding-top:2.5rem;padding-bottom:2.5rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.text-left{text-align:left}.text-center{text-align:center}.text-2xl{font-size:1.5rem;line-height:2rem}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-4xl{font-size:2.25rem;line-height:2.5rem}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.tracking-\\[0\\.2em\\]{letter-spacing:.2em}.tracking-tight{letter-spacing:-.025em}.tracking-wide{letter-spacing:.025em}.text-emerald-700{--tw-text-opacity: 1;color:rgb(4 120 87 / var(--tw-text-opacity, 1))}.text-rose-700{--tw-text-opacity: 1;color:rgb(190 18 60 / var(--tw-text-opacity, 1))}.text-slate-200{--tw-text-opacity: 1;color:rgb(226 232 240 / var(--tw-text-opacity, 1))}.text-slate-400{--tw-text-opacity: 1;color:rgb(148 163 184 / var(--tw-text-opacity, 1))}.text-slate-500{--tw-text-opacity: 1;color:rgb(100 116 139 / var(--tw-text-opacity, 1))}.text-slate-600{--tw-text-opacity: 1;color:rgb(71 85 105 / var(--tw-text-opacity, 1))}.text-slate-700{--tw-text-opacity: 1;color:rgb(51 65 85 / var(--tw-text-opacity, 1))}.text-slate-900{--tw-text-opacity: 1;color:rgb(15 23 42 / var(--tw-text-opacity, 1))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.shadow-inner{--tw-shadow: inset 0 2px 4px 0 #0000000d;--tw-shadow-colored: inset 0 2px 4px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-soft{--tw-shadow: 0 10px 40px #0f172a14;--tw-shadow-colored: 0 10px 40px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-slate-100{--tw-shadow-color: #f1f5f9;--tw-shadow: var(--tw-shadow-colored)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.hover\\:-translate-y-\\[1px\\]:hover{--tw-translate-y: -1px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.hover\\:shadow-lg:hover{--tw-shadow: 0 10px 15px -3px #0000001a, 0 4px 6px -4px #0000001a;--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.focus-visible\\:outline:focus-visible{outline-style:solid}.focus-visible\\:outline-2:focus-visible{outline-width:2px}.focus-visible\\:outline-offset-2:focus-visible{outline-offset:2px}.focus-visible\\:outline-slate-400:focus-visible{outline-color:#94a3b8}.active\\:translate-y-\\[1px\\]:active{--tw-translate-y: 1px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group:hover .group-hover\\:translate-x-0\\.5{--tw-translate-x: .125rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@media (min-width: 768px){.md\\:mt-6{margin-top:1.5rem}.md\\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.md\\:gap-6{gap:1.5rem}.md\\:py-12{padding-top:3rem;padding-bottom:3rem}.md\\:text-4xl{font-size:2.25rem;line-height:2.5rem}}.heatmap-container{width:100%;overflow-x:auto}.heatmap-svg{min-width:720px}.heatmap-day{cursor:pointer}.heatmap-day:hover{stroke:#00000024;stroke-width:1px}.heatmap-legend{display:flex;align-items:center;gap:4px;font-size:12px;color:#64748b;margin-top:8px}.heatmap-legend-item{width:10px;height:10px;border-radius:2px}.nav-toc{display:flex;flex-wrap:wrap;gap:8px;margin:24px 0 32px;padding:16px;background:#fff;border-radius:8px;border:1px solid #e2e8f0}.nav-toc a{font-size:12px;color:#64748b;text-decoration:none;padding:6px 12px;border-radius:6px;background:#f1f5f9;transition:all .15s}.nav-toc a:hover{background:#e2e8f0;color:#334155}.at-a-glance{background:linear-gradient(135deg,#fef3c7,#fde68a);border:1px solid #f59e0b;border-radius:12px;padding:20px 24px;margin-bottom:32px}.glance-title{font-size:16px;font-weight:700;color:#92400e;margin-bottom:16px}.glance-sections{display:flex;flex-direction:column;gap:12px}.glance-section{font-size:14px;color:#78350f;line-height:1.6}.glance-section strong{color:#92400e;font-weight:700}.see-more{color:#b45309;text-decoration:none;font-size:13px;white-space:nowrap;margin-left:4px}.see-more:hover{text-decoration:underline}.project-areas{display:flex;flex-direction:column;gap:12px;margin-bottom:32px}.project-area{background:#fff;border:1px solid #e2e8f0;border-radius:8px;padding:16px}.area-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:8px}.area-name{font-weight:600;font-size:15px;color:#0f172a}.area-count{font-size:12px;color:#64748b;background:#f1f5f9;padding:2px 8px;border-radius:4px}.area-desc{font-size:14px;color:#475569;line-height:1.5}.narrative{background:#fff;border:1px solid #e2e8f0;border-radius:8px;padding:20px;margin-bottom:24px}.narrative p{margin-top:0;margin-bottom:12px;font-size:14px;color:#475569;line-height:1.7}.key-insight{background:#f0fdf4;border:1px solid #bbf7d0;border-radius:8px;padding:12px 16px;margin-top:12px;font-size:14px;color:#166534}.section-intro{font-size:14px;color:#64748b;margin-bottom:16px}.big-wins{display:flex;flex-direction:column;gap:12px;margin-bottom:24px}.big-win{background:#f0fdf4;border:1px solid #bbf7d0;border-radius:8px;padding:16px}.big-win-title{font-weight:600;font-size:15px;color:#166534;margin-bottom:8px}.big-win-desc{font-size:14px;color:#15803d;line-height:1.5}.friction-categories{display:flex;flex-direction:column;gap:16px;margin-bottom:24px}.friction-category{background:#fef2f2;border:1px solid #fca5a5;border-radius:8px;padding:16px}.friction-title{font-weight:600;font-size:15px;color:#991b1b;margin-bottom:6px}.friction-desc{font-size:13px;color:#7f1d1d;margin-bottom:10px}.friction-examples{margin:0 0 0 10px;padding:0;font-size:13px;color:#334155;list-style-type:disc}.friction-examples li{margin-bottom:4px}.qwen-md-section{background:#eff6ff;border:1px solid #bfdbfe;border-radius:8px;padding:12px;margin-bottom:20px}.qwen-md-section h3{font-size:13px;font-weight:600;color:#1e40af;margin:0 0 8px}.qwen-md-actions{margin-bottom:8px;padding-bottom:8px;border-bottom:1px solid #dbeafe}.copy-all-btn{background:#2563eb;color:#fff;border:none;border-radius:4px;padding:4px 10px;font-size:11px;cursor:pointer;font-weight:500;transition:all .2s}.copy-all-btn:hover{background:#1d4ed8}.copy-all-btn.copied{background:#16a34a}.qwen-md-item{display:flex;flex-wrap:wrap;align-items:flex-start;gap:8px;padding:8px 0;border-bottom:1px solid #dbeafe}.qwen-md-item:last-child{border-bottom:none}.cmd-checkbox{margin-top:2px}.cmd-code{background:#fff;padding:6px 10px;border-radius:4px;font-size:11px;color:#1e40af;border:1px solid #bfdbfe;font-family:monospace;display:block;white-space:pre-wrap;word-break:break-word;flex:1}.cmd-why{font-size:11px;color:#64748b;width:100%;padding-left:20px;margin-top:4px}.features-section,.patterns-section{display:flex;flex-direction:column;gap:12px;margin:16px 0}.feature-card{background:#f0fdf4;border:1px solid #86efac;border-radius:8px;padding:16px}.pattern-card{background:#f0f9ff;border:1px solid #7dd3fc;border-radius:8px;padding:16px}.feature-title,.pattern-title{font-weight:600;font-size:15px;color:#0f172a;margin-bottom:6px}.feature-oneliner,.pattern-summary{font-size:14px;color:#475569;margin-bottom:8px}.feature-why,.pattern-detail{font-size:13px;color:#334155;line-height:1.5}.feature-examples{margin-top:12px}.feature-example{padding:8px 0;border-top:1px solid #d1fae5}.feature-example:first-child{border-top:none}.example-code-row,.copyable-prompt-row{display:flex;align-items:flex-start;gap:8px}.example-code{flex:1;background:#f1f5f9;padding:8px 12px;border-radius:4px;font-family:monospace;font-size:12px;color:#334155;overflow-x:auto;white-space:pre-wrap}.copyable-prompt-section{margin-top:12px;padding-top:12px;border-top:1px solid #e2e8f0}.copyable-prompt{flex:1;background:#f8fafc;padding:10px 12px;border-radius:4px;font-family:monospace;font-size:12px;color:#334155;border:1px solid #e2e8f0;white-space:pre-wrap;line-height:1.5}.prompt-label{font-size:11px;font-weight:600;text-transform:uppercase;color:#64748b;margin-bottom:6px}.copy-btn{background:#e2e8f0;border:none;border-radius:4px;padding:4px 8px;font-size:11px;cursor:pointer;color:#475569;flex-shrink:0;transition:all .2s}.copy-btn:hover{background:#cbd5e1}.horizon-section{display:flex;flex-direction:column;gap:16px}.horizon-card{background:linear-gradient(135deg,#faf5ff,#f5f3ff);border:1px solid #c4b5fd;border-radius:8px;padding:16px}.horizon-title{font-weight:600;font-size:15px;color:#5b21b6;margin-bottom:8px}.horizon-possible{font-size:14px;color:#334155;margin-bottom:10px;line-height:1.5}.horizon-tip{font-size:13px;color:#6b21a8;background:#fff9;padding:8px 12px;border-radius:4px}.pattern-prompt{background:#f8fafc;padding:12px;border-radius:6px;margin-top:12px;border:1px solid #e2e8f0;display:flex;flex-direction:column;gap:8px}.pattern-prompt code{font-family:monospace;font-size:12px;color:#334155;display:block;white-space:pre-wrap}.fun-ending{background:linear-gradient(135deg,#fef3c7,#fde68a);border:1px solid #fbbf24;border-radius:12px;padding:24px;margin-top:40px;text-align:center}.fun-headline{font-size:18px;font-weight:600;color:#78350f;margin-bottom:8px}.fun-detail{font-size:14px;color:#92400e}.stats-row{display:flex;gap:24px;margin-bottom:40px;padding:20px 0;border-top:1px solid #e2e8f0;border-bottom:1px solid #e2e8f0;flex-wrap:wrap}.stat{text-align:center}.stat-value{font-size:24px;font-weight:700;color:#0f172a}.stat-label{font-size:11px;color:#64748b;text-transform:uppercase}@media (max-width: 640px){.stats-row{justify-content:center}}.header-with-action{position:relative}.insights-header{margin-bottom:2rem;padding:1.5rem 0;border-bottom:1px solid #e2e8f0}.header-content{display:flex;justify-content:space-between;align-items:center;gap:1.5rem;flex-wrap:wrap}.header-title-section{flex:1;min-width:0}.header-title{font-size:1.75rem;font-weight:700;color:#0f172a;letter-spacing:-.02em;margin:0 0 .375rem;line-height:1.2}.header-subtitle{font-size:.875rem;color:#64748b;margin:0;font-weight:400}.export-dropdown-wrapper{position:relative}.export-card-btn{display:inline-flex;align-items:center;gap:.5rem;height:36px;padding:0 .875rem;border:1px solid #e2e8f0;border-radius:8px;background:#fff;color:#334155;font-size:.8125rem;font-weight:500;cursor:pointer;transition:all .15s ease}.export-card-btn:hover{background:#f8fafc;border-color:#cbd5e1}.export-card-btn:active{background:#f1f5f9}.export-chevron{transition:transform .15s ease;opacity:.5}.export-chevron.open{transform:rotate(180deg)}.export-dropdown{position:absolute;top:calc(100% + 4px);right:0;min-width:160px;background:#fff;border:1px solid #e2e8f0;border-radius:8px;box-shadow:0 4px 16px #00000014;padding:4px;z-index:50}.export-dropdown-item{display:flex;align-items:center;gap:.5rem;width:100%;padding:.5rem .75rem;border:none;border-radius:6px;background:none;color:#334155;font-size:.8125rem;font-weight:400;cursor:pointer;transition:background .1s ease}.export-dropdown-item:hover{background:#f1f5f9}.export-dropdown-item:active{background:#e2e8f0}@media (max-width: 640px){.header-content{flex-direction:column;align-items:flex-start;gap:1rem}.header-title{font-size:1.5rem}}';
|
|
3579
|
+
|
|
3580
|
+
// packages/web-templates/src/generated/exportHtmlTemplate.ts
|
|
3581
|
+
init_esbuild_shims();
|
|
3582
|
+
var HTML_TEMPLATE = '<!doctype html>\n<html lang="en" class="dark">\n <head>\n <meta charset="UTF-8" />\n <meta name="viewport" content="width=device-width, initial-scale=1.0" />\n <link\n rel="icon"\n type="image/svg+xml"\n href="data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20141.38%20140%22%3E%0A%20%20%3Cpath%0A%20%20%20%20fill%3D%22%23000000%22%0A%20%20%20%20d%3D%22m140.93%2085-16.35-28.33-1.93-3.34%208.66-15a3.323%203.323%200%200%200%200-3.34l-9.62-16.67c-.3-.51-.72-.93-1.22-1.22s-1.07-.45-1.67-.45H82.23l-8.66-15a3.33%203.33%200%200%200-2.89-1.67H51.43c-.59%200-1.17.16-1.66.45-.5.29-.92.71-1.22%201.22L32.19%2029.98l-1.92%203.33H12.96c-.59%200-1.17.16-1.66.45-.5.29-.93.71-1.22%201.22L.45%2051.66a3.323%203.323%200%200%200%200%203.34l18.28%2031.67-8.66%2015a3.32%203.32%200%200%200%200%203.34l9.62%2016.67c.3.51.72.93%201.22%201.22s1.07.45%201.67.45h36.56l8.66%2015a3.35%203.35%200%200%200%202.89%201.67h19.25a3.34%203.34%200%200%200%202.89-1.67l18.28-31.67h17.32c.6%200%201.17-.16%201.67-.45s.92-.71%201.22-1.22l9.62-16.67a3.323%203.323%200%200%200%200-3.34ZM51.44%203.33%2061.07%2020l-9.63%2016.66h76.98l-9.62%2016.66H45.67l-11.54-20zM57.21%20120H22.58l9.63-16.67h19.25l-38.5-66.67h19.25l9.62%2016.67L68.78%20100l-11.55%2020Zm61.59-33.34-9.62-16.67-38.49%2066.67-9.63-16.67%209.63-16.66%2026.94-46.67h23.1l17.32%2030z%22%0A%20%20%2F%3E%0A%3C%2Fsvg%3E"\n />\n <script\n crossorigin\n src="https://unpkg.com/react@18.2.0/umd/react.production.min.js"\n ></script>\n <script\n crossorigin\n src="https://unpkg.com/react-dom@18.2.0/umd/react-dom.production.min.js"\n ></script>\n <script>\n const withKey = (props, key) =>\n key == null ? props : Object.assign({}, props, { key });\n const jsx = (type, props, key) =>\n React.createElement(type, withKey(props, key));\n const jsxRuntime = {\n Fragment: React.Fragment,\n jsx,\n jsxs: jsx,\n jsxDEV: jsx,\n };\n window.ReactJSXRuntime = jsxRuntime;\n window[\'react/jsx-runtime\'] = jsxRuntime;\n window[\'react/jsx-dev-runtime\'] = jsxRuntime;\n </script>\n <script>\n (function(g,a){typeof exports=="object"&&typeof module<"u"?a(exports,require("react/jsx-runtime"),require("react")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react"],a):(g=typeof globalThis<"u"?globalThis:g||self,a(g.QwenCodeWebUI={},g.ReactJSXRuntime,g.React))})(this,function(g,a,C){"use strict";const _r={platform:"web",postMessage:()=>{},onMessage:()=>()=>{}},Ze=C.createContext(_r);function re(){return C.useContext(Ze)}function Cr({children:e,value:u}){return a.jsx(Ze.Provider,{value:u,children:e})}/**\n * @license\n * Copyright 2025 Qwen Team\n * SPDX-License-Identifier: Apache-2.0\n */const Fe=C.createContext(null);function Er(){return C.useContext(Fe)}function ne(e=!1){const u=C.useContext(Fe),t=(u==null?void 0:u.signal)??0,[r,n]=C.useState(()=>u&&t>0?u.expanded:e),[o,c]=C.useState(t);return t!==o&&(c(t),u&&t>0&&n(u.expanded)),[r,n]}/**\n * @license\n * Copyright 2025 Qwen Team\n * SPDX-License-Identifier: Apache-2.0\n */const Dr=({children:e,className:u=""})=>a.jsx("div",{className:`container mx-auto px-4 ${u}`,children:e});/**\n * @license\n * Copyright 2025 Qwen Team\n * SPDX-License-Identifier: Apache-2.0\n */const Ar=()=>a.jsx("header",{children:"Header Component Placeholder"});/**\n * @license\n * Copyright 2025 Qwen Team\n * SPDX-License-Identifier: Apache-2.0\n */const Fr=()=>a.jsx("aside",{children:"Sidebar Component Placeholder"});/**\n * @license\n * Copyright 2025 Qwen Team\n * SPDX-License-Identifier: Apache-2.0\n */const Nr=()=>a.jsx("main",{children:"Main Component Placeholder"});/**\n * @license\n * Copyright 2025 Qwen Team\n * SPDX-License-Identifier: Apache-2.0\n */const Sr=()=>a.jsx("footer",{children:"Footer Component Placeholder"});function Tr(e){const u=e.split(/[/\\\\]/);return u[u.length-1]||e}function ku(e,u,t){let r=e;return u!=null&&(r+=`:${u}`,t!=null&&(r+=`:${t}`)),r}const j=({path:e,line:u,column:t,showFullPath:r=!1,className:n="",disableClick:o=!1})=>{var p;const c=re(),s=((p=c.features)==null?void 0:p.canOpenFile)!==!1,l=o||!s,i=()=>{if(l)return;const k=ku(e,u,t);c.openFile?c.openFile(k):c.postMessage({type:"openFile",data:{path:k}})},d=k=>{k.preventDefault(),l||(k.stopPropagation(),i())},f=k=>{l||(k.key===" "||k.key==="Enter")&&(k.preventDefault(),k.stopPropagation(),i())},b=r?e:Tr(e),h=ku(e,u,t);return a.jsxs("button",{type:"button",className:["file-link","bg-transparent border-none p-0 m-0 font-inherit","inline-flex items-center leading-none",l?"cursor-default opacity-60":"cursor-pointer hover:underline","text-[11px] no-underline","text-[var(--app-primary-foreground)]","transition-colors duration-100 ease-in-out","focus:outline focus:outline-1 focus:outline-[var(--vscode-focusBorder)] focus:outline-offset-2 focus:rounded-[2px]",!l&&"active:opacity-80",n].filter(Boolean).join(" "),onClick:d,onKeyDown:f,title:h,"aria-label":`Open file: ${h}`,"aria-disabled":l,disabled:l,children:[a.jsx("span",{className:"file-link-path",children:b}),u!=null&&a.jsxs("span",{className:"file-link-location opacity-70 text-[0.9em] font-normal dark:opacity-60",children:[":",u,t!=null&&a.jsxs(a.Fragment,{children:[":",t]})]})]})};/**\n * @license\n * Copyright 2025 Qwen Team\n * SPDX-License-Identifier: Apache-2.0\n *\n * Navigation and action icons\n */const vu=({size:e=20,className:u,...t})=>a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",width:e,height:e,className:u,"aria-hidden":"true",...t,children:a.jsx("path",{fillRule:"evenodd",d:"M5.22 8.22a.75.75 0 0 1 1.06 0L10 11.94l3.72-3.72a.75.75 0 1 1 1.06 1.06l-4.25 4.25a.75.75 0 0 1-1.06 0L5.22 9.28a.75.75 0 0 1 0-1.06Z",clipRule:"evenodd"})}),Ir=e=>{switch(e){case"up":return 180;case"down":return 0;case"left":return 90;case"right":return-90;default:return 0}},Mr=({size:e=12,className:u,direction:t="down",style:r,...n})=>a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",width:e,height:e,className:u,"aria-hidden":"true",style:{...r,transform:`rotate(${Ir(t)}deg)`,transition:"transform 0.15s ease-in-out"},...n,children:a.jsx("path",{d:"M3 4.5L6 7.5L9 4.5"})}),wu=({size:e=20,className:u,...t})=>a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",width:e,height:e,className:u,"aria-hidden":"true",...t,children:a.jsx("path",{d:"M10.75 4.75a.75.75 0 0 0-1.5 0v4.5h-4.5a.75.75 0 0 0 0 1.5h4.5v4.5a.75.75 0 0 0 1.5 0v-4.5h4.5a.75.75 0 0 0 0-1.5h-4.5v-4.5Z"})}),Lr=({size:e=16,className:u,...t})=>a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor",width:e,height:e,className:u,"aria-hidden":"true",...t,children:a.jsx("path",{d:"M8 2a.5.5 0 0 1 .5.5V5h2.5a.5.5 0 0 1 0 1H8.5v2.5a.5.5 0 0 1-1 0V6H5a.5.5 0 0 1 0-1h2.5V2.5A.5.5 0 0 1 8 2Z"})}),_u=({size:e=20,className:u,...t})=>a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",width:e,height:e,className:u,"aria-hidden":"true",...t,children:a.jsx("path",{fillRule:"evenodd",d:"M10 17a.75.75 0 0 1-.75-.75V5.612L5.29 9.77a.75.75 0 0 1-1.08-1.04l5.25-5.5a.75.75 0 0 1 1.08 0l5.25 5.5a.75.75 0 1 1-1.08 1.04l-3.96-4.158V16.25A.75.75 0 0 1 10 17Z",clipRule:"evenodd"})}),Pr=({size:e=14,className:u,...t})=>a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 14 14",fill:"none",width:e,height:e,className:u,"aria-hidden":"true",...t,children:a.jsx("path",{d:"M1 1L13 13M1 13L13 1",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})}),Cu=({size:e=16,className:u,...t})=>a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor",width:e,height:e,className:u,"aria-hidden":"true",...t,children:a.jsx("path",{d:"M4.646 4.646a.5.5 0 0 1 .708 0L8 7.293l2.646-2.647a.5.5 0 0 1 .708.708L8.707 8l2.647 2.646a.5.5 0 0 1-.708.708L8 8.707l-2.646 2.647a.5.5 0 0 1-.708-.708L7.293 8 4.646 5.354a.5.5 0 0 1 0-.708Z"})}),Eu=({size:e=20,className:u,...t})=>a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",width:e,height:e,className:u,"aria-hidden":"true",...t,children:a.jsx("path",{fillRule:"evenodd",d:"M9 3.5a5.5 5.5 0 1 0 0 11 5.5 5.5 0 0 0 0-11ZM2 9a7 7 0 1 1 12.452 4.391l3.328 3.329a.75.75 0 1 1-1.06 1.06l-3.329-3.328A7 7 0 0 1 2 9Z",clipRule:"evenodd"})}),Br=({size:e=16,className:u,...t})=>a.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",width:e,height:e,className:u,"aria-hidden":"true",...t,children:[a.jsx("path",{d:"M13.3333 8C13.3333 10.9455 10.9455 13.3333 8 13.3333C5.05451 13.3333 2.66663 10.9455 2.66663 8C2.66663 5.05451 5.05451 2.66663 8 2.66663"}),a.jsx("path",{d:"M10.6666 8L13.3333 8M13.3333 8L13.3333 5.33333M13.3333 8L10.6666 10.6667"})]}),$r=({currentSessionTitle:e,onLoadSessions:u,onNewSession:t})=>a.jsxs("div",{className:"chat-header flex items-center select-none w-full border-b border-[var(--app-primary-border-color)] bg-[var(--app-header-background)] py-1.5 px-2.5",style:{borderBottom:"1px solid var(--app-primary-border-color)"},children:[a.jsxs("button",{type:"button",className:"flex items-center gap-1.5 py-0.5 px-2 bg-transparent border-none rounded cursor-pointer outline-none min-w-0 max-w-[300px] overflow-hidden text-[var(--vscode-chat-font-size,13px)] font-[var(--vscode-chat-font-family)] text-[var(--app-primary-foreground)] hover:bg-[var(--app-ghost-button-hover-background)] focus:bg-[var(--app-ghost-button-hover-background)]",onClick:u,title:"Past conversations",children:[a.jsx("span",{className:"whitespace-nowrap overflow-hidden text-ellipsis min-w-0 font-medium text-[var(--app-primary-foreground)]",children:e}),a.jsx(vu,{className:"w-4 h-4 flex-shrink-0 text-[var(--app-primary-foreground)]"})]}),a.jsx("div",{className:"flex-1 min-w-0"}),a.jsx("button",{type:"button",className:"flex items-center justify-center p-1 bg-transparent border-none rounded cursor-pointer outline-none text-[var(--app-primary-foreground)] hover:bg-[var(--app-ghost-button-hover-background)]",onClick:t,title:"New Session","aria-label":"New session",style:{padding:"4px"},children:a.jsx(wu,{className:"w-4 h-4 text-[var(--app-primary-foreground)]"})})]});/**\n * @license\n * Copyright 2025 Qwen Team\n * SPDX-License-Identifier: Apache-2.0\n */const Du=({children:e,content:u,position:t="top"})=>a.jsx("div",{className:"relative inline-block",children:a.jsxs("div",{className:"group relative",children:[e,a.jsxs("div",{className:`\n absolute z-50 px-2 py-1 text-xs rounded-md shadow-lg\n bg-[var(--app-primary-background,#1f2937)] border border-[var(--app-input-border,#374151)]\n text-[var(--app-primary-foreground,#f9fafb)] whitespace-nowrap\n opacity-0 group-hover:opacity-100 transition-opacity duration-150\n -translate-x-1/2 left-1/2\n ${t==="top"?"-translate-y-1 bottom-full mb-1":t==="bottom"?"translate-y-1 top-full mt-1":t==="left"?"-translate-x-full left-0 translate-y-[-50%] top-1/2":"translate-x-0 right-0 translate-y-[-50%] top-1/2"}\n pointer-events-none\n `,children:[u,a.jsx("div",{className:`\n absolute w-2 h-2 bg-[var(--app-primary-background,#1f2937)] border-l border-b border-[var(--app-input-border,#374151)]\n -rotate-45\n ${t==="top"?"top-full left-1/2 -translate-x-1/2 -translate-y-1/2":t==="bottom"?"bottom-full left-1/2 -translate-x-1/2 translate-y-1/2":t==="left"?"right-full top-1/2 translate-x-1/2 -translate-y-1/2":"left-full top-1/2 -translate-x-1/2 -translate-y-1/2"}\n `})]})]})}),Ne=e=>e>=1e3?`${(Math.round(e/1e3*10)/10).toFixed(1)}k`:Math.round(e).toLocaleString(),Au=({contextUsage:e})=>{if(!e)return null;const u=Math.max(0,Math.min(100,100-e.percentLeft)),t=Math.round(u),r=9,n=2*Math.PI*r,o=(100-u)/100*n,c=a.jsx("div",{className:"flex flex-col gap-1",children:a.jsxs("div",{className:"font-medium",children:[t,"% \u2022 ",Ne(e.usedTokens)," /"," ",Ne(e.tokenLimit)," context used"]})}),s=`${t}% \u2022 ${Ne(e.usedTokens)} / ${Ne(e.tokenLimit)} context used`;return a.jsx(Du,{content:c,position:"top",children:a.jsx("button",{type:"button",className:"btn-icon-compact","aria-label":s,children:a.jsxs("svg",{viewBox:"0 0 24 24","aria-hidden":"true",role:"presentation",children:[a.jsx("circle",{className:"context-indicator__track",cx:"12",cy:"12",r,fill:"none",stroke:"currentColor",opacity:"0.2"}),a.jsx("circle",{className:"context-indicator__progress",cx:"12",cy:"12",r,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeDasharray:n,strokeDashoffset:o,style:{transform:"rotate(-90deg)",transformOrigin:"50% 50%"}})]})})})},Or=e=>{const u=new Map;for(const t of e){const r=t.group||null;u.has(r)||u.set(r,[]),u.get(r).push(t)}return Array.from(u.entries()).map(([t,r])=>({group:t,items:r}))},Fu=({items:e,onSelect:u,onFill:t,onClose:r,title:n,selectedIndex:o=0})=>{const c=C.useRef(null),s=C.useRef(null),[l,i]=C.useState(o),[d,f]=C.useState(!1),b=C.useRef(!1),h=C.useMemo(()=>Or(e),[e]),p=h.some(y=>y.group!==null);if(C.useEffect(()=>{if(!e.length)return;const y=Math.min(Math.max(o,0),e.length-1);i(y)},[e.length,o]),C.useEffect(()=>f(!0),[]),C.useEffect(()=>{const y=x=>{c.current&&!c.current.contains(x.target)&&r()},D=x=>{switch(x.key){case"ArrowDown":x.preventDefault(),b.current=!0,i(m=>Math.min(m+1,e.length-1));break;case"ArrowUp":x.preventDefault(),b.current=!0,i(m=>Math.max(m-1,0));break;case"Enter":x.preventDefault(),e[l]&&u(e[l]);break;case"Tab":x.preventDefault(),e[l]&&(t??u)(e[l]);break;case"Escape":x.preventDefault(),r();break}};return document.addEventListener("mousedown",y),document.addEventListener("keydown",D),()=>{document.removeEventListener("mousedown",y),document.removeEventListener("keydown",D)}},[e,l,u,t,r]),C.useEffect(()=>{var D;if(!b.current)return;b.current=!1;const y=(D=s.current)==null?void 0:D.querySelector(`[data-index="${l}"]`);if(y&&s.current){const x=s.current.getBoundingClientRect(),m=y.getBoundingClientRect();m.top<x.top?y.scrollIntoView({block:"start",behavior:"instant"}):m.bottom>x.bottom&&y.scrollIntoView({block:"end",behavior:"instant"})}},[l]),!e.length)return null;let k=0;return a.jsxs("div",{ref:c,role:"listbox","aria-label":n?`${n} suggestions`:"Suggestions",className:["completion-menu","absolute bottom-full left-0 right-0 mb-2 flex flex-col overflow-hidden","rounded-large border bg-[var(--app-menu-background)]","border-[var(--app-input-border)] max-h-[50vh] z-[1000]",d?"animate-completion-menu-enter":""].join(" "),children:[a.jsx("div",{className:"h-1"}),a.jsxs("div",{ref:s,className:["completion-menu-list","flex max-h-[300px] flex-col overflow-y-auto","p-[var(--app-list-padding)] pb-2"].join(" "),children:[n&&!p&&a.jsx("div",{className:"completion-menu-section-label px-3 py-1 text-[var(--app-primary-foreground)] opacity-50 text-[0.9em]",children:n}),h.map((y,D)=>a.jsxs("div",{className:"completion-menu-group",children:[p&&y.group&&a.jsx("div",{className:"completion-menu-section-label px-3 py-1.5 text-[var(--app-secondary-foreground)] text-[0.8em] uppercase tracking-wider",children:y.group}),a.jsx("div",{className:"flex flex-col gap-[var(--app-list-gap)]",children:y.items.map(x=>{const m=k++,_=m===l;return a.jsx("div",{"data-index":m,role:"option","aria-selected":_,onClick:()=>u(x),onMouseEnter:()=>i(m),className:["completion-menu-item","mx-1 cursor-pointer rounded-[var(--app-list-border-radius)]","p-[var(--app-list-item-padding)]",_?"bg-[var(--app-list-active-background)]":""].join(" "),children:a.jsxs("div",{className:"completion-menu-item-row flex items-center justify-between gap-2",children:[x.icon&&a.jsx("span",{className:"completion-menu-item-icon inline-flex h-4 w-4 items-center justify-center text-[var(--vscode-symbolIcon-fileForeground,#cccccc)]",children:x.icon}),a.jsx("span",{className:["completion-menu-item-label flex-1 truncate",_?"text-[var(--app-list-active-foreground)]":"text-[var(--app-primary-foreground)]"].join(" "),children:x.label}),x.description&&a.jsx("span",{className:"completion-menu-item-desc max-w-[50%] truncate text-[0.9em] text-[var(--app-secondary-foreground)] opacity-70",title:x.description,children:x.description})]})},x.id)})})]},y.group||`ungrouped-${D}`))]})]})};/**\n * @license\n * Copyright 2025 Qwen Team\n * SPDX-License-Identifier: Apache-2.0\n *\n * Session grouping utilities\n * Functions for organizing sessions by date and formatting time ago\n */const Nu=e=>{const u=new Date,t=new Date(u.getFullYear(),u.getMonth(),u.getDate()),r=new Date(t);r.setDate(r.getDate()-1);const n={Today:[],Yesterday:[],"This Week":[],Older:[]};return e.forEach(o=>{const c=o.lastUpdated||o.startTime||"";if(!c){n.Older.push(o);return}const s=new Date(c),l=new Date(s.getFullYear(),s.getMonth(),s.getDate());l.getTime()===t.getTime()?n.Today.push(o):l.getTime()===r.getTime()?n.Yesterday.push(o):l.getTime()>t.getTime()-7*864e5?n["This Week"].push(o):n.Older.push(o)}),Object.entries(n).filter(([,o])=>o.length>0).map(([o,c])=>({label:o,sessions:c}))},Su=e=>{if(!e)return"";const u=new Date().getTime(),t=new Date(e).getTime(),r=u-t,n=Math.floor(r/6e4),o=Math.floor(r/36e5),c=Math.floor(r/864e5);return n<1?"now":n<60?`${n}m`:o<24?`${o}h`:c===1?"Yesterday":c<7?`${c}d`:new Date(e).toLocaleDateString()},zr=({visible:e,sessions:u,currentSessionId:t,searchQuery:r,onSearchChange:n,onSelectSession:o,onRenameSession:c,onDeleteSession:s,onClose:l,hasMore:i=!1,isLoading:d=!1,onLoadMore:f})=>{const[b,h]=C.useState(null),[p,k]=C.useState(""),[y,D]=C.useState(""),[x,m]=C.useState(null),_=C.useRef(null),v=C.useRef(!1);C.useEffect(()=>{b&&_.current&&(_.current.focus(),_.current.select())},[b]);const w=F=>{const E=p.trim();E&&E!==y&&c&&c(F,E),h(null),k(""),D("")};if(!e)return null;const N=u.length===0;return a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"session-selector-backdrop fixed top-0 left-0 right-0 bottom-0 z-[999] bg-transparent",onClick:l}),a.jsxs("div",{className:"session-dropdown fixed bg-[var(--app-menu-background)] rounded-[var(--corner-radius-small)] w-[min(400px,calc(100vw-32px))] max-h-[min(500px,50vh)] flex flex-col shadow-[0_4px_16px_rgba(0,0,0,0.1)] z-[1000] outline-none text-[var(--vscode-chat-font-size,13px)] font-[var(--vscode-chat-font-family)]",tabIndex:-1,style:{top:"30px",left:"10px"},onClick:F=>F.stopPropagation(),children:[a.jsxs("div",{className:"session-search p-2 flex items-center gap-2",children:[a.jsx(Eu,{className:"session-search-icon w-4 h-4 opacity-50 flex-shrink-0 text-[var(--app-primary-foreground)]"}),a.jsx("input",{type:"text",className:"session-search-input flex-1 bg-transparent border-none outline-none text-[var(--app-menu-foreground)] text-[var(--vscode-chat-font-size,13px)] font-[var(--vscode-chat-font-family)] p-0 placeholder:text-[var(--app-input-placeholder-foreground)] placeholder:opacity-60",placeholder:"Search sessions\u2026","aria-label":"Search sessions",value:r,onChange:F=>n(F.target.value)})]}),a.jsxs("div",{className:"session-list-content overflow-y-auto flex-1 select-none p-2",onScroll:F=>{const E=F.currentTarget;E.scrollHeight-(E.scrollTop+E.clientHeight)<48&&i&&!d&&(f==null||f())},children:[N?a.jsx("div",{className:"p-5 text-center text-[var(--app-secondary-foreground)]",style:{padding:"20px",textAlign:"center",color:"var(--app-secondary-foreground)"},children:r?"No matching sessions":"No sessions available"}):Nu(u).map(F=>a.jsxs(C.Fragment,{children:[a.jsx("div",{className:"session-group-label p-1 px-2 text-[var(--app-primary-foreground)] opacity-50 text-[0.9em] font-medium [&:not(:first-child)]:mt-2",children:F.label}),a.jsx("div",{className:"session-group flex flex-col gap-[2px]",children:F.sessions.map(E=>{const A=E.id||E.sessionId||"",S=E.title||E.name||"Untitled",T=E.lastUpdated||E.startTime||"",L=A===t;return b===A?a.jsx("div",{className:"session-item flex items-center py-1.5 px-2 rounded-md",children:a.jsx("input",{ref:_,type:"text",maxLength:200,className:"flex-1 bg-[var(--vscode-input-background,var(--app-input-background))] text-[var(--vscode-input-foreground,var(--app-primary-foreground))] border-2 border-[var(--vscode-focusBorder)] rounded px-2 py-1 text-[var(--vscode-chat-font-size,13px)] font-[var(--vscode-chat-font-family)] outline-none min-w-0 shadow-[0_0_0_1px_var(--vscode-focusBorder)]",value:p,onChange:I=>k(I.target.value),onKeyDown:I=>{I.key==="Enter"?w(A):I.key==="Escape"&&(v.current=!0,h(null),k(""),D(""))},onBlur:()=>{if(v.current){v.current=!1;return}w(A)}})},A):a.jsxs("div",{className:`session-item group flex items-center justify-between py-1.5 px-2 rounded-md cursor-pointer transition-colors duration-100 hover:bg-[var(--app-list-hover-background)] ${L?"active bg-[var(--app-list-active-background)] text-[var(--app-list-active-foreground)] font-[600]":"text-[var(--app-primary-foreground)]"}`,onClick:()=>{o(A),l()},children:[a.jsx("span",{className:"session-item-title flex-1 overflow-hidden text-ellipsis whitespace-nowrap min-w-0 text-[var(--vscode-chat-font-size,13px)] font-[var(--vscode-chat-font-family)]",children:S}),a.jsxs("span",{className:"flex items-center gap-1 flex-shrink-0 ml-2",children:[(c||s)&&a.jsxs("span",{className:`items-center gap-0.5 ${x===A?"flex":"hidden group-hover:flex"}`,children:[c&&a.jsx("button",{type:"button",className:"p-0.5 bg-transparent border-none cursor-pointer opacity-50 hover:opacity-100 text-[var(--app-primary-foreground)] rounded",title:"Rename",onClick:I=>{I.stopPropagation(),h(A),k(S),D(S)},children:a.jsx("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"currentColor",children:a.jsx("path",{d:"M13.23 1h-1.46L3.52 9.25l-.16.22L1 13.59 2.41 15l4.12-2.36.22-.16L15 4.23V2.77L13.23 1zM2.41 13.59l1.51-3 1.45 1.45-2.96 1.55zm3.83-2.06L4.47 9.76l8-8 1.77 1.77-8 8z"})})}),s&&!L&&(x===A?a.jsx("button",{type:"button",className:"px-1.5 py-0.5 bg-[var(--vscode-inputValidation-errorBackground,#5a1d1d)] border border-[var(--vscode-inputValidation-errorBorder,#be1100)] cursor-pointer text-[var(--vscode-errorForeground,#f48771)] rounded text-[11px] leading-tight",title:"Click to confirm delete",onClick:I=>{I.stopPropagation(),m(null),s(A)},onBlur:()=>m(null),children:"Delete?"}):a.jsx("button",{type:"button",className:"p-0.5 bg-transparent border-none cursor-pointer opacity-50 hover:opacity-100 text-[var(--app-primary-foreground)] rounded",title:"Delete",onClick:I=>{I.stopPropagation(),m(A)},children:a.jsx("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"currentColor",children:a.jsx("path",{d:"M10 3h3v1h-1v9l-1 1H5l-1-1V4H3V3h3V2a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v1zM9 2H7v1h2V2zM5 4v9h6V4H5zm2 2h1v5H7V6zm3 0h-1v5h1V6z"})})}))]}),a.jsx("span",{className:"session-item-time opacity-60 text-[0.9em]",children:Su(T)})]})]},A)})})]},F.label)),i&&a.jsx("div",{className:"p-2 text-center opacity-60 text-[0.9em]",children:d?"Loading\u2026":""})]})]})]})},jr=({isAuthenticated:e=!1,loadingMessage:u,logoUrl:t,appName:r="Qwen Code"})=>{var s;const n=re(),o=t??((s=n.getResourceUrl)==null?void 0:s.call(n,"icon.png")),c=u?`Preparing ${r}\u2026`:e?"What would you like to do? Ask about this codebase or we can start writing code.":`Welcome! Please log in to start using ${r}.`;return a.jsx("div",{className:"flex flex-col items-center justify-center h-full p-5 md:p-10",children:a.jsx("div",{className:"flex flex-col items-center gap-8 w-full",children:a.jsxs("div",{className:"flex flex-col items-center gap-6",children:[o?a.jsx("img",{src:o,alt:`${r} Logo`,className:"w-[60px] h-[60px] object-contain",onError:l=>{const i=l.target;i.style.display="none";const d=i.parentElement;if(d){const f=document.createElement("div");f.className="w-[60px] h-[60px] flex items-center justify-center text-2xl font-bold",f.textContent=r.charAt(0).toUpperCase(),d.appendChild(f)}}}):a.jsx("div",{className:"w-[60px] h-[60px] flex items-center justify-center text-2xl font-bold bg-gray-200 rounded",children:r.charAt(0).toUpperCase()}),a.jsx("div",{className:"text-center",children:a.jsx("div",{className:"text-[15px] text-app-primary-foreground leading-normal font-normal max-w-[400px]",children:c})})]})})})};/**\n * @license\n * Copyright 2025 Qwen Team\n * SPDX-License-Identifier: Apache-2.0\n *\n * Edit mode related icons\n */const Ve=({size:e=16,className:u,...t})=>a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor",width:e,height:e,className:u,"aria-hidden":"true",...t,children:a.jsx("path",{fillRule:"evenodd",d:"M11.013 2.513a1.75 1.75 0 0 1 2.475 2.474L6.226 12.25a2.751 2.751 0 0 1-.892.596l-2.047.848a.75.75 0 0 1-.98-.98l.848-2.047a2.75 2.75 0 0 1 .596-.892l7.262-7.261Z",clipRule:"evenodd"})}),Tu=({size:e=16,className:u,...t})=>a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor",width:e,height:e,className:u,"aria-hidden":"true",...t,children:a.jsx("path",{d:"M2.53 3.956A1 1 0 0 0 1 4.804v6.392a1 1 0 0 0 1.53.848l5.113-3.196c.16-.1.279-.233.357-.383v2.73a1 1 0 0 0 1.53.849l5.113-3.196a1 1 0 0 0 0-1.696L9.53 3.956A1 1 0 0 0 8 4.804v2.731a.992.992 0 0 0-.357-.383L2.53 3.956Z"})}),Iu=({size:e=16,className:u,...t})=>a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor",width:e,height:e,className:u,"aria-hidden":"true",...t,children:a.jsx("path",{d:"M4.5 2a.5.5 0 0 0-.5.5v11a.5.5 0 0 0 .5.5h1a.5.5 0 0 0 .5-.5v-11a.5.5 0 0 0-.5-.5h-1ZM10.5 2a.5.5 0 0 0-.5.5v11a.5.5 0 0 0 .5.5h1a.5.5 0 0 0 .5-.5v-11a.5.5 0 0 0-.5-.5h-1Z"})}),Mu=({size:e=20,className:u,...t})=>a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",width:e,height:e,className:u,"aria-hidden":"true",...t,children:a.jsx("path",{fillRule:"evenodd",d:"M6.28 5.22a.75.75 0 0 1 0 1.06L2.56 10l3.72 3.72a.75.75 0 0 1-1.06 1.06L.97 10.53a.75.75 0 0 1 0-1.06l4.25-4.25a.75.75 0 0 1 1.06 0Zm7.44 0a.75.75 0 0 1 1.06 0l4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.75.75 0 0 1-1.06-1.06L17.44 10l-3.72-3.72a.75.75 0 0 1 0-1.06ZM11.377 2.011a.75.75 0 0 1 .612.867l-2.5 14.5a.75.75 0 0 1-1.478-.255l2.5-14.5a.75.75 0 0 1 .866-.612Z",clipRule:"evenodd"})}),Lu=({size:e=20,className:u,...t})=>a.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",width:e,height:e,className:u,"aria-hidden":"true",...t,children:[a.jsx("path",{fillRule:"evenodd",d:"M3.28 2.22a.75.75 0 0 0-1.06 1.06l14.5 14.5a.75.75 0 1 0 1.06-1.06l-1.745-1.745a10.029 10.029 0 0 0 3.3-4.38 1.651 1.651 0 0 0 0-1.185A10.004 10.004 0 0 0 9.999 3a9.956 9.956 0 0 0-4.744 1.194L3.28 2.22ZM7.752 6.69l1.092 1.092a2.5 2.5 0 0 1 3.374 3.373l1.091 1.092a4 4 0 0 0-5.557-5.557Z",clipRule:"evenodd"}),a.jsx("path",{d:"m10.748 13.93 2.523 2.523a9.987 9.987 0 0 1-3.27.547c-4.258 0-7.894-2.66-9.337-6.41a1.651 1.651 0 0 1 0-1.186A10.007 10.007 0 0 1 2.839 6.02L6.07 9.252a4 4 0 0 0 4.678 4.678Z"})]}),Pu=({size:e=20,className:u,...t})=>a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",width:e,height:e,className:u,"aria-hidden":"true",...t,children:a.jsx("path",{fillRule:"evenodd",d:"M12.528 3.047a.75.75 0 0 1 .449.961L8.433 16.504a.75.75 0 1 1-1.41-.512l4.544-12.496a.75.75 0 0 1 .961-.449Z",clipRule:"evenodd"})}),Bu=({size:e=20,className:u,...t})=>a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",width:e,height:e,className:u,"aria-hidden":"true",...t,children:a.jsx("path",{fillRule:"evenodd",d:"M15.621 4.379a3 3 0 0 0-4.242 0l-7 7a3 3 0 0 0 4.241 4.243h.001l.497-.5a.75.75 0 0 1 1.064 1.057l-.498.501-.002.002a4.5 4.5 0 0 1-6.364-6.364l7-7a4.5 4.5 0 0 1 6.368 6.36l-3.455 3.553A2.625 2.625 0 1 1 9.52 9.52l3.45-3.451a.75.75 0 1 1 1.061 1.06l-3.45 3.451a1.125 1.125 0 0 0 1.587 1.595l3.454-3.553a3 3 0 0 0 0-4.242Z",clipRule:"evenodd"})}),qr=({size:e=16,className:u,...t})=>a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor",width:e,height:e,className:u,"aria-hidden":"true",...t,children:a.jsx("path",{d:"M13.5 7l-4-4v3h-6v2h6v3l4-4z"})}),Hr=({size:e=16,className:u,...t})=>a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"none",width:e,height:e,className:u,"aria-hidden":"true",...t,children:a.jsx("path",{d:"M9 10.6667L12.3333 14L9 17.3333M12.3333 14H4.66667C3.56112 14 2.66667 13.1056 2.66667 12V4.66667C2.66667 3.56112 3.56112 2.66667 4.66667 2.66667H13.3333C14.4389 2.66667 15.3333 3.56112 15.3333 4.66667V8.66667",stroke:"currentColor",strokeWidth:"1.33333",strokeLinecap:"round",strokeLinejoin:"round"})}),Zr=({size:e=16,className:u,...t})=>a.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"none",width:e,height:e,className:u,"aria-hidden":"true",...t,children:[a.jsx("rect",{x:"4.6665",y:"4",width:"8",height:"8",rx:"1.33333",stroke:"currentColor",strokeWidth:"1.33333"}),a.jsx("path",{d:"M6 6H5.33333C4.04767 6 3 7.04767 3 8.33333V10.6667C3 11.9523 4.04767 13 5.33333 13H7.66667C8.95233 13 10 11.9523 10 10.6667V10",stroke:"currentColor",strokeWidth:"1.33333",strokeLinecap:"round"})]});/**\n * @license\n * Copyright 2025 Qwen Team\n * SPDX-License-Identifier: Apache-2.0\n *\n * Stop icon for canceling operations\n */const $u=({size:e=16,className:u,...t})=>a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor",width:e,height:e,className:u,"aria-hidden":"true",...t,children:a.jsx("rect",{x:"4",y:"4",width:"8",height:"8",rx:"1"})});/**\n * @license\n * Copyright 2025 Qwen Team\n * SPDX-License-Identifier: Apache-2.0\n */const Vr="\u200B";function Se(e){return e.replace(/\\u200B/g,"")}const Ur=e=>{switch(e){case"edit":return a.jsx(Ve,{});case"auto":case"yolo":return a.jsx(Tu,{});case"plan":return a.jsx(Iu,{});default:return null}},Wr=({inputText:e,inputFieldRef:u,isStreaming:t,isWaitingForResponse:r,isComposing:n,editModeInfo:o,activeFileName:c,activeSelection:s,skipAutoActiveContext:l,contextUsage:i,onInputChange:d,onCompositionStart:f,onCompositionEnd:b,onKeyDown:h,onSubmit:p,onCancel:k,onToggleEditMode:y,onToggleSkipAutoActiveContext:D,onShowCommandMenu:x,onAttachContext:m,completionIsOpen:_,completionItems:v,onCompletionSelect:w,onCompletionFill:N,onCompletionClose:F,onPaste:E,extraContent:A,placeholder:S="Ask Qwen Code \u2026",canSubmit:T,followupState:L,onAcceptFollowup:I,onDismissFollowup:z})=>{const pe=t||r,Xa=T??Se(e).trim().length>0,kr=v??[],De=_&&kr.length>0&&!!w&&!!F,He=L!=null&&L.isVisible&&L.suggestion?L.suggestion:null,he=!!He,Ja=he&&!e?He:S,Qa=P=>{if(De&&P.key==="Escape"){P.preventDefault(),P.stopPropagation(),F==null||F();return}if(P.key==="Escape"){P.preventDefault(),k();return}if(P.key==="Tab"&&he&&I&&!e&&!De){P.preventDefault(),P.stopPropagation(),I("tab");return}if(P.key==="ArrowRight"&&he&&I&&!e&&!De){P.preventDefault(),I==null||I("right");return}if(P.key==="Enter"&&!P.shiftKey&&!n){if(De)return;if(he&&!e&&He){P.preventDefault(),I==null||I("enter",{skipOnAccept:!0}),p(P,He);return}P.preventDefault(),p(P)}h(P)},yu=s?Math.max(1,s.endLine-s.startLine+1):0,Ae=yu>0?`${yu} ${yu===1?"line":"lines"} selected`:"",vr=c?l?Ae?`Active selection will NOT be auto-loaded into context: ${Ae}`:`Active file will NOT be auto-loaded into context: ${c}`:Ae?`Showing your current selection: ${Ae}`:`Showing your current file: ${c}`:"";return a.jsx("div",{className:"p-1 px-4 pb-4 absolute bottom-0 left-0 right-0 bg-gradient-to-b from-transparent to-[var(--app-primary-background)] pointer-events-none",children:a.jsx("div",{className:"block pointer-events-auto",children:a.jsxs("form",{className:"composer-form",onSubmit:p,children:[a.jsx("div",{className:"composer-overlay"}),a.jsx("div",{className:"input-banner"}),a.jsxs("div",{className:"relative flex z-[1]",children:[De&&w&&F&&a.jsx(Fu,{items:kr,onSelect:w,onFill:N,onClose:F,title:void 0}),a.jsx("div",{ref:u,contentEditable:"plaintext-only",className:"composer-input",role:"textbox","aria-label":"Message input","aria-multiline":"true","data-placeholder":Ja,"data-has-suggestion":he?"true":"false","data-empty":Se(e).trim().length===0?"true":"false",onInput:P=>{const Ka=P.target,wr=Se(Ka.textContent??"");d(wr),he&&!e&&wr&&(z==null||z())},onCompositionStart:f,onCompositionEnd:b,onKeyDown:Qa,onPaste:E,suppressContentEditableWarning:!0})]}),A?a.jsx("div",{className:"relative z-[1]",children:A}):null,a.jsxs("div",{className:"composer-actions",children:[a.jsxs("button",{type:"button",className:"btn-text-compact btn-text-compact--primary",title:o.title,"aria-label":o.label,onClick:y,children:[o.icon,a.jsx("span",{className:"hidden sm:inline",children:o.label})]}),c&&a.jsxs("button",{type:"button",className:"btn-text-compact btn-text-compact--primary",title:vr,"aria-label":vr,onClick:D,children:[l?a.jsx(Lu,{}):a.jsx(Mu,{}),a.jsx("span",{className:"hidden sm:inline",children:Ae||c})]}),a.jsx("div",{className:"flex-1 min-w-0"}),a.jsx(Au,{contextUsage:i}),a.jsx("button",{type:"button",className:"btn-icon-compact hover:text-[var(--app-primary-foreground)]",title:"Show command menu (/)","aria-label":"Show command menu",onClick:x,children:a.jsx(Pu,{})}),a.jsx("button",{type:"button",className:"btn-icon-compact hover:text-[var(--app-primary-foreground)]",title:"Attach context (Cmd/Ctrl + /)","aria-label":"Attach context",onClick:m,children:a.jsx(Bu,{})}),t||r?a.jsx("button",{type:"button",className:"btn-send-compact [&>svg]:w-5 [&>svg]:h-5",onClick:k,title:"Stop generation","aria-label":"Stop generation",children:a.jsx($u,{})}):a.jsx("button",{type:"submit",className:"btn-send-compact [&>svg]:w-5 [&>svg]:h-5",disabled:pe||!Xa,"aria-label":"Send message",children:a.jsx(_u,{})})]})]})})})};/**\n * @license\n * Copyright 2025 Qwen Team\n * SPDX-License-Identifier: Apache-2.0\n *\n * Onboarding component - Pure UI welcome screen\n * Platform-specific logic (icon URL) passed via props\n */const Gr=({iconUrl:e,onGetStarted:u,appName:t="Qwen Code",subtitle:r="Unlock the power of AI to understand, navigate, and transform your codebase faster than ever before.",buttonText:n="Get Started with Qwen Code"})=>a.jsx("div",{className:"flex flex-col items-center justify-center h-full p-5 md:p-10",children:a.jsx("div",{className:"flex flex-col items-center gap-8 w-full max-w-md mx-auto",children:a.jsxs("div",{className:"flex flex-col items-center gap-6",children:[e&&a.jsx("div",{className:"relative",children:a.jsx("img",{src:e,alt:`${t} Logo`,className:"w-[80px] h-[80px] object-contain"})}),a.jsxs("div",{className:"text-center",children:[a.jsxs("h1",{className:"text-2xl font-bold text-[var(--app-primary-foreground)] mb-2",children:["Welcome to ",t]}),a.jsx("p",{className:"text-[var(--app-secondary-foreground)] max-w-sm",children:r})]}),a.jsx("button",{onClick:u,className:"w-full px-4 py-3 bg-[var(--app-primary,var(--app-button-background))] text-[var(--app-button-foreground,#ffffff)] font-medium rounded-lg shadow-sm hover:bg-[var(--app-primary-hover,var(--app-button-hover-background))] transition-colors duration-200",children:n})]})})});/**\n * @license\n * Copyright 2025 Qwen Team\n * SPDX-License-Identifier: Apache-2.0\n */const Xr=({content:e,sender:u,timestamp:t,className:r=""})=>{const n=u==="user"?"justify-end":"justify-start",o=u==="user"?"bg-blue-500":"bg-gray-200";return a.jsx("div",{className:`flex ${n} mb-4 ${r}`,children:a.jsxs("div",{className:`${o} text-white rounded-lg px-4 py-2 max-w-xs md:max-w-md lg:max-w-lg`,children:[e,t&&a.jsx("div",{className:"text-xs opacity-70 mt-1",children:t.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]})})};/**\n * @license\n * Copyright 2025 Qwen Team\n * SPDX-License-Identifier: Apache-2.0\n */const Jr=()=>a.jsx("div",{children:"MessageInput Component Placeholder"});/**\n * @license\n * Copyright 2025 Qwen Team\n * SPDX-License-Identifier: Apache-2.0\n */const Qr=()=>a.jsx("div",{children:"MessageList Component Placeholder"}),Kr=3e3,Yr=["Processing...","Working on it...","Just a moment...","Loading...","Hold tight...","Almost there..."],Rr=({loadingMessage:e})=>{const u=C.useMemo(()=>{const n=new Set,o=[];e&&e.trim()&&(o.push(e),n.add(e));for(const c of Yr)n.has(c)||o.push(c);return o},[e]),[t,r]=C.useState(0);return C.useEffect(()=>{r(0)},[u]),C.useEffect(()=>{if(u.length<=1)return;const n=setInterval(()=>{r(o=>{let c=Math.floor(Math.random()*u.length);if(u.length>1){let s=0;for(;c===o&&s<5;)c=Math.floor(Math.random()*u.length),s++}return c})},Kr);return()=>clearInterval(n)},[u]),a.jsx("div",{className:"waiting-message-outer flex gap-0 items-start text-left py-2 flex-col opacity-85",children:a.jsx("div",{className:"assistant-message-container assistant-message-loading waiting-message-inner w-full items-start pl-[30px] relative",children:a.jsx("span",{className:"waiting-message-text opacity-70 italic loading-text-shimmer",children:u[t]})})})};/**\n * @license\n * Copyright 2025 Qwen Team\n * SPDX-License-Identifier: Apache-2.0\n */const en=({text:e="Interrupted"})=>a.jsx("div",{className:"flex gap-0 items-start text-left py-2 flex-col opacity-85",children:a.jsx("div",{className:"interrupted-item w-full relative",children:a.jsx("span",{className:"opacity-70 italic",children:e})})}),Ou={};function un(e){let u=Ou[e];if(u)return u;u=Ou[e]=[];for(let t=0;t<128;t++){const r=String.fromCharCode(t);u.push(r)}for(let t=0;t<e.length;t++){const r=e.charCodeAt(t);u[r]="%"+("0"+r.toString(16).toUpperCase()).slice(-2)}return u}function ae(e,u){typeof u!="string"&&(u=ae.defaultChars);const t=un(u);return e.replace(/(%[a-f0-9]{2})+/gi,function(r){let n="";for(let o=0,c=r.length;o<c;o+=3){const s=parseInt(r.slice(o+1,o+3),16);if(s<128){n+=t[s];continue}if((s&224)===192&&o+3<c){const l=parseInt(r.slice(o+4,o+6),16);if((l&192)===128){const i=s<<6&1984|l&63;i<128?n+="\uFFFD\uFFFD":n+=String.fromCharCode(i),o+=3;continue}}if((s&240)===224&&o+6<c){const l=parseInt(r.slice(o+4,o+6),16),i=parseInt(r.slice(o+7,o+9),16);if((l&192)===128&&(i&192)===128){const d=s<<12&61440|l<<6&4032|i&63;d<2048||d>=55296&&d<=57343?n+="\uFFFD\uFFFD\uFFFD":n+=String.fromCharCode(d),o+=6;continue}}if((s&248)===240&&o+9<c){const l=parseInt(r.slice(o+4,o+6),16),i=parseInt(r.slice(o+7,o+9),16),d=parseInt(r.slice(o+10,o+12),16);if((l&192)===128&&(i&192)===128&&(d&192)===128){let f=s<<18&1835008|l<<12&258048|i<<6&4032|d&63;f<65536||f>1114111?n+="\uFFFD\uFFFD\uFFFD\uFFFD":(f-=65536,n+=String.fromCharCode(55296+(f>>10),56320+(f&1023))),o+=9;continue}}n+="\uFFFD"}return n})}ae.defaultChars=";/?:@&=+$,#",ae.componentChars="";const zu={};function tn(e){let u=zu[e];if(u)return u;u=zu[e]=[];for(let t=0;t<128;t++){const r=String.fromCharCode(t);/^[0-9a-z]$/i.test(r)?u.push(r):u.push("%"+("0"+t.toString(16).toUpperCase()).slice(-2))}for(let t=0;t<e.length;t++)u[e.charCodeAt(t)]=e[t];return u}function be(e,u,t){typeof u!="string"&&(t=u,u=be.defaultChars),typeof t>"u"&&(t=!0);const r=tn(u);let n="";for(let o=0,c=e.length;o<c;o++){const s=e.charCodeAt(o);if(t&&s===37&&o+2<c&&/^[0-9a-f]{2}$/i.test(e.slice(o+1,o+3))){n+=e.slice(o,o+3),o+=2;continue}if(s<128){n+=r[s];continue}if(s>=55296&&s<=57343){if(s>=55296&&s<=56319&&o+1<c){const l=e.charCodeAt(o+1);if(l>=56320&&l<=57343){n+=encodeURIComponent(e[o]+e[o+1]),o++;continue}}n+="%EF%BF%BD";continue}n+=encodeURIComponent(e[o])}return n}be.defaultChars=";/?:@&=+$,-_.!~*\'()#",be.componentChars="-_.!~*\'()";function Ue(e){let u="";return u+=e.protocol||"",u+=e.slashes?"//":"",u+=e.auth?e.auth+"@":"",e.hostname&&e.hostname.indexOf(":")!==-1?u+="["+e.hostname+"]":u+=e.hostname||"",u+=e.port?":"+e.port:"",u+=e.pathname||"",u+=e.search||"",u+=e.hash||"",u}function Te(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}const rn=/^([a-z0-9.+-]+:)/i,nn=/:[0-9]*$/,on=/^(\\/\\/?(?!\\/)[^\\?\\s]*)(\\?[^\\s]*)?$/,an=["<",">",\'"\',"`"," ","\\r",`\n`," "],cn=["{","}","|","\\\\","^","`"].concat(an),sn=["\'"].concat(cn),ju=["%","/","?",";","#"].concat(sn),qu=["/","?","#"],ln=255,Hu=/^[+a-z0-9A-Z_-]{0,63}$/,dn=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,Zu={javascript:!0,"javascript:":!0},Vu={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function We(e,u){if(e&&e instanceof Te)return e;const t=new Te;return t.parse(e,u),t}Te.prototype.parse=function(e,u){let t,r,n,o=e;if(o=o.trim(),!u&&e.split("#").length===1){const i=on.exec(o);if(i)return this.pathname=i[1],i[2]&&(this.search=i[2]),this}let c=rn.exec(o);if(c&&(c=c[0],t=c.toLowerCase(),this.protocol=c,o=o.substr(c.length)),(u||c||o.match(/^\\/\\/[^@\\/]+@[^@\\/]+/))&&(n=o.substr(0,2)==="//",n&&!(c&&Zu[c])&&(o=o.substr(2),this.slashes=!0)),!Zu[c]&&(n||c&&!Vu[c])){let i=-1;for(let p=0;p<qu.length;p++)r=o.indexOf(qu[p]),r!==-1&&(i===-1||r<i)&&(i=r);let d,f;i===-1?f=o.lastIndexOf("@"):f=o.lastIndexOf("@",i),f!==-1&&(d=o.slice(0,f),o=o.slice(f+1),this.auth=d),i=-1;for(let p=0;p<ju.length;p++)r=o.indexOf(ju[p]),r!==-1&&(i===-1||r<i)&&(i=r);i===-1&&(i=o.length),o[i-1]===":"&&i--;const b=o.slice(0,i);o=o.slice(i),this.parseHost(b),this.hostname=this.hostname||"";const h=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!h){const p=this.hostname.split(/\\./);for(let k=0,y=p.length;k<y;k++){const D=p[k];if(D&&!D.match(Hu)){let x="";for(let m=0,_=D.length;m<_;m++)D.charCodeAt(m)>127?x+="x":x+=D[m];if(!x.match(Hu)){const m=p.slice(0,k),_=p.slice(k+1),v=D.match(dn);v&&(m.push(v[1]),_.unshift(v[2])),_.length&&(o=_.join(".")+o),this.hostname=m.join(".");break}}}}this.hostname.length>ln&&(this.hostname=""),h&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}const s=o.indexOf("#");s!==-1&&(this.hash=o.substr(s),o=o.slice(0,s));const l=o.indexOf("?");return l!==-1&&(this.search=o.substr(l),o=o.slice(0,l)),o&&(this.pathname=o),Vu[t]&&this.hostname&&!this.pathname&&(this.pathname=""),this},Te.prototype.parseHost=function(e){let u=nn.exec(e);u&&(u=u[0],u!==":"&&(this.port=u.substr(1)),e=e.substr(0,e.length-u.length)),e&&(this.hostname=e)};const fn=Object.freeze(Object.defineProperty({__proto__:null,decode:ae,encode:be,format:Ue,parse:We},Symbol.toStringTag,{value:"Module"})),Uu=/[\\0-\\uD7FF\\uE000-\\uFFFF]|[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]|[\\uD800-\\uDBFF](?![\\uDC00-\\uDFFF])|(?:[^\\uD800-\\uDBFF]|^)[\\uDC00-\\uDFFF]/,Wu=/[\\0-\\x1F\\x7F-\\x9F]/,pn=/[\\xAD\\u0600-\\u0605\\u061C\\u06DD\\u070F\\u0890\\u0891\\u08E2\\u180E\\u200B-\\u200F\\u202A-\\u202E\\u2060-\\u2064\\u2066-\\u206F\\uFEFF\\uFFF9-\\uFFFB]|\\uD804[\\uDCBD\\uDCCD]|\\uD80D[\\uDC30-\\uDC3F]|\\uD82F[\\uDCA0-\\uDCA3]|\\uD834[\\uDD73-\\uDD7A]|\\uDB40[\\uDC01\\uDC20-\\uDC7F]/,Ge=/[!-#%-\\*,-\\/:;\\?@\\[-\\]_\\{\\}\\xA1\\xA7\\xAB\\xB6\\xB7\\xBB\\xBF\\u037E\\u0387\\u055A-\\u055F\\u0589\\u058A\\u05BE\\u05C0\\u05C3\\u05C6\\u05F3\\u05F4\\u0609\\u060A\\u060C\\u060D\\u061B\\u061D-\\u061F\\u066A-\\u066D\\u06D4\\u0700-\\u070D\\u07F7-\\u07F9\\u0830-\\u083E\\u085E\\u0964\\u0965\\u0970\\u09FD\\u0A76\\u0AF0\\u0C77\\u0C84\\u0DF4\\u0E4F\\u0E5A\\u0E5B\\u0F04-\\u0F12\\u0F14\\u0F3A-\\u0F3D\\u0F85\\u0FD0-\\u0FD4\\u0FD9\\u0FDA\\u104A-\\u104F\\u10FB\\u1360-\\u1368\\u1400\\u166E\\u169B\\u169C\\u16EB-\\u16ED\\u1735\\u1736\\u17D4-\\u17D6\\u17D8-\\u17DA\\u1800-\\u180A\\u1944\\u1945\\u1A1E\\u1A1F\\u1AA0-\\u1AA6\\u1AA8-\\u1AAD\\u1B5A-\\u1B60\\u1B7D\\u1B7E\\u1BFC-\\u1BFF\\u1C3B-\\u1C3F\\u1C7E\\u1C7F\\u1CC0-\\u1CC7\\u1CD3\\u2010-\\u2027\\u2030-\\u2043\\u2045-\\u2051\\u2053-\\u205E\\u207D\\u207E\\u208D\\u208E\\u2308-\\u230B\\u2329\\u232A\\u2768-\\u2775\\u27C5\\u27C6\\u27E6-\\u27EF\\u2983-\\u2998\\u29D8-\\u29DB\\u29FC\\u29FD\\u2CF9-\\u2CFC\\u2CFE\\u2CFF\\u2D70\\u2E00-\\u2E2E\\u2E30-\\u2E4F\\u2E52-\\u2E5D\\u3001-\\u3003\\u3008-\\u3011\\u3014-\\u301F\\u3030\\u303D\\u30A0\\u30FB\\uA4FE\\uA4FF\\uA60D-\\uA60F\\uA673\\uA67E\\uA6F2-\\uA6F7\\uA874-\\uA877\\uA8CE\\uA8CF\\uA8F8-\\uA8FA\\uA8FC\\uA92E\\uA92F\\uA95F\\uA9C1-\\uA9CD\\uA9DE\\uA9DF\\uAA5C-\\uAA5F\\uAADE\\uAADF\\uAAF0\\uAAF1\\uABEB\\uFD3E\\uFD3F\\uFE10-\\uFE19\\uFE30-\\uFE52\\uFE54-\\uFE61\\uFE63\\uFE68\\uFE6A\\uFE6B\\uFF01-\\uFF03\\uFF05-\\uFF0A\\uFF0C-\\uFF0F\\uFF1A\\uFF1B\\uFF1F\\uFF20\\uFF3B-\\uFF3D\\uFF3F\\uFF5B\\uFF5D\\uFF5F-\\uFF65]|\\uD800[\\uDD00-\\uDD02\\uDF9F\\uDFD0]|\\uD801\\uDD6F|\\uD802[\\uDC57\\uDD1F\\uDD3F\\uDE50-\\uDE58\\uDE7F\\uDEF0-\\uDEF6\\uDF39-\\uDF3F\\uDF99-\\uDF9C]|\\uD803[\\uDEAD\\uDF55-\\uDF59\\uDF86-\\uDF89]|\\uD804[\\uDC47-\\uDC4D\\uDCBB\\uDCBC\\uDCBE-\\uDCC1\\uDD40-\\uDD43\\uDD74\\uDD75\\uDDC5-\\uDDC8\\uDDCD\\uDDDB\\uDDDD-\\uDDDF\\uDE38-\\uDE3D\\uDEA9]|\\uD805[\\uDC4B-\\uDC4F\\uDC5A\\uDC5B\\uDC5D\\uDCC6\\uDDC1-\\uDDD7\\uDE41-\\uDE43\\uDE60-\\uDE6C\\uDEB9\\uDF3C-\\uDF3E]|\\uD806[\\uDC3B\\uDD44-\\uDD46\\uDDE2\\uDE3F-\\uDE46\\uDE9A-\\uDE9C\\uDE9E-\\uDEA2\\uDF00-\\uDF09]|\\uD807[\\uDC41-\\uDC45\\uDC70\\uDC71\\uDEF7\\uDEF8\\uDF43-\\uDF4F\\uDFFF]|\\uD809[\\uDC70-\\uDC74]|\\uD80B[\\uDFF1\\uDFF2]|\\uD81A[\\uDE6E\\uDE6F\\uDEF5\\uDF37-\\uDF3B\\uDF44]|\\uD81B[\\uDE97-\\uDE9A\\uDFE2]|\\uD82F\\uDC9F|\\uD836[\\uDE87-\\uDE8B]|\\uD83A[\\uDD5E\\uDD5F]/,Gu=/[\\$\\+<->\\^`\\|~\\xA2-\\xA6\\xA8\\xA9\\xAC\\xAE-\\xB1\\xB4\\xB8\\xD7\\xF7\\u02C2-\\u02C5\\u02D2-\\u02DF\\u02E5-\\u02EB\\u02ED\\u02EF-\\u02FF\\u0375\\u0384\\u0385\\u03F6\\u0482\\u058D-\\u058F\\u0606-\\u0608\\u060B\\u060E\\u060F\\u06DE\\u06E9\\u06FD\\u06FE\\u07F6\\u07FE\\u07FF\\u0888\\u09F2\\u09F3\\u09FA\\u09FB\\u0AF1\\u0B70\\u0BF3-\\u0BFA\\u0C7F\\u0D4F\\u0D79\\u0E3F\\u0F01-\\u0F03\\u0F13\\u0F15-\\u0F17\\u0F1A-\\u0F1F\\u0F34\\u0F36\\u0F38\\u0FBE-\\u0FC5\\u0FC7-\\u0FCC\\u0FCE\\u0FCF\\u0FD5-\\u0FD8\\u109E\\u109F\\u1390-\\u1399\\u166D\\u17DB\\u1940\\u19DE-\\u19FF\\u1B61-\\u1B6A\\u1B74-\\u1B7C\\u1FBD\\u1FBF-\\u1FC1\\u1FCD-\\u1FCF\\u1FDD-\\u1FDF\\u1FED-\\u1FEF\\u1FFD\\u1FFE\\u2044\\u2052\\u207A-\\u207C\\u208A-\\u208C\\u20A0-\\u20C0\\u2100\\u2101\\u2103-\\u2106\\u2108\\u2109\\u2114\\u2116-\\u2118\\u211E-\\u2123\\u2125\\u2127\\u2129\\u212E\\u213A\\u213B\\u2140-\\u2144\\u214A-\\u214D\\u214F\\u218A\\u218B\\u2190-\\u2307\\u230C-\\u2328\\u232B-\\u2426\\u2440-\\u244A\\u249C-\\u24E9\\u2500-\\u2767\\u2794-\\u27C4\\u27C7-\\u27E5\\u27F0-\\u2982\\u2999-\\u29D7\\u29DC-\\u29FB\\u29FE-\\u2B73\\u2B76-\\u2B95\\u2B97-\\u2BFF\\u2CE5-\\u2CEA\\u2E50\\u2E51\\u2E80-\\u2E99\\u2E9B-\\u2EF3\\u2F00-\\u2FD5\\u2FF0-\\u2FFF\\u3004\\u3012\\u3013\\u3020\\u3036\\u3037\\u303E\\u303F\\u309B\\u309C\\u3190\\u3191\\u3196-\\u319F\\u31C0-\\u31E3\\u31EF\\u3200-\\u321E\\u322A-\\u3247\\u3250\\u3260-\\u327F\\u328A-\\u32B0\\u32C0-\\u33FF\\u4DC0-\\u4DFF\\uA490-\\uA4C6\\uA700-\\uA716\\uA720\\uA721\\uA789\\uA78A\\uA828-\\uA82B\\uA836-\\uA839\\uAA77-\\uAA79\\uAB5B\\uAB6A\\uAB6B\\uFB29\\uFBB2-\\uFBC2\\uFD40-\\uFD4F\\uFDCF\\uFDFC-\\uFDFF\\uFE62\\uFE64-\\uFE66\\uFE69\\uFF04\\uFF0B\\uFF1C-\\uFF1E\\uFF3E\\uFF40\\uFF5C\\uFF5E\\uFFE0-\\uFFE6\\uFFE8-\\uFFEE\\uFFFC\\uFFFD]|\\uD800[\\uDD37-\\uDD3F\\uDD79-\\uDD89\\uDD8C-\\uDD8E\\uDD90-\\uDD9C\\uDDA0\\uDDD0-\\uDDFC]|\\uD802[\\uDC77\\uDC78\\uDEC8]|\\uD805\\uDF3F|\\uD807[\\uDFD5-\\uDFF1]|\\uD81A[\\uDF3C-\\uDF3F\\uDF45]|\\uD82F\\uDC9C|\\uD833[\\uDF50-\\uDFC3]|\\uD834[\\uDC00-\\uDCF5\\uDD00-\\uDD26\\uDD29-\\uDD64\\uDD6A-\\uDD6C\\uDD83\\uDD84\\uDD8C-\\uDDA9\\uDDAE-\\uDDEA\\uDE00-\\uDE41\\uDE45\\uDF00-\\uDF56]|\\uD835[\\uDEC1\\uDEDB\\uDEFB\\uDF15\\uDF35\\uDF4F\\uDF6F\\uDF89\\uDFA9\\uDFC3]|\\uD836[\\uDC00-\\uDDFF\\uDE37-\\uDE3A\\uDE6D-\\uDE74\\uDE76-\\uDE83\\uDE85\\uDE86]|\\uD838[\\uDD4F\\uDEFF]|\\uD83B[\\uDCAC\\uDCB0\\uDD2E\\uDEF0\\uDEF1]|\\uD83C[\\uDC00-\\uDC2B\\uDC30-\\uDC93\\uDCA0-\\uDCAE\\uDCB1-\\uDCBF\\uDCC1-\\uDCCF\\uDCD1-\\uDCF5\\uDD0D-\\uDDAD\\uDDE6-\\uDE02\\uDE10-\\uDE3B\\uDE40-\\uDE48\\uDE50\\uDE51\\uDE60-\\uDE65\\uDF00-\\uDFFF]|\\uD83D[\\uDC00-\\uDED7\\uDEDC-\\uDEEC\\uDEF0-\\uDEFC\\uDF00-\\uDF76\\uDF7B-\\uDFD9\\uDFE0-\\uDFEB\\uDFF0]|\\uD83E[\\uDC00-\\uDC0B\\uDC10-\\uDC47\\uDC50-\\uDC59\\uDC60-\\uDC87\\uDC90-\\uDCAD\\uDCB0\\uDCB1\\uDD00-\\uDE53\\uDE60-\\uDE6D\\uDE70-\\uDE7C\\uDE80-\\uDE88\\uDE90-\\uDEBD\\uDEBF-\\uDEC5\\uDECE-\\uDEDB\\uDEE0-\\uDEE8\\uDEF0-\\uDEF8\\uDF00-\\uDF92\\uDF94-\\uDFCA]/,Xu=/[ \\xA0\\u1680\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000]/,hn=Object.freeze(Object.defineProperty({__proto__:null,Any:Uu,Cc:Wu,Cf:pn,P:Ge,S:Gu,Z:Xu},Symbol.toStringTag,{value:"Module"})),bn=new Uint16Array(\'\u1D41<\xD5\u0131\u028A\u049D\u057B\u05D0\u0675\u06DE\u07A2\u07D6\u080F\u0A4A\u0A91\u0DA1\u0E6D\u0F09\u0F26\u10CA\u1228\u12E1\u1415\u149D\u14C3\u14DF\u1525\\0\\0\\0\\0\\0\\0\u156B\u16CD\u198D\u1C12\u1DDD\u1F7E\u2060\u21B0\u228D\u23C0\u23FB\u2442\u2824\u2912\u2D08\u2E48\u2FCE\u3016\u32BA\u3639\u37AC\u38FE\u3A28\u3A71\u3AE0\u3B2E\u0800EMabcfglmnoprstu\\\\bfms\x7F\x84\x8B\x90\x95\x98\xA6\xB3\xB9\xC8\xCFlig\u803B\xC6\u40C6P\u803B&\u4026cute\u803B\xC1\u40C1reve;\u4102\u0100iyx}rc\u803B\xC2\u40C2;\u4410r;\uC000\u{1D504}rave\u803B\xC0\u40C0pha;\u4391acr;\u4100d;\u6A53\u0100gp\x9D\xA1on;\u4104f;\uC000\u{1D538}plyFunction;\u6061ing\u803B\xC5\u40C5\u0100cs\xBE\xC3r;\uC000\u{1D49C}ign;\u6254ilde\u803B\xC3\u40C3ml\u803B\xC4\u40C4\u0400aceforsu\xE5\xFB\xFE\u0117\u011C\u0122\u0127\u012A\u0100cr\xEA\xF2kslash;\u6216\u0176\xF6\xF8;\u6AE7ed;\u6306y;\u4411\u0180crt\u0105\u010B\u0114ause;\u6235noullis;\u612Ca;\u4392r;\uC000\u{1D505}pf;\uC000\u{1D539}eve;\u42D8c\xF2\u0113mpeq;\u624E\u0700HOacdefhilorsu\u014D\u0151\u0156\u0180\u019E\u01A2\u01B5\u01B7\u01BA\u01DC\u0215\u0273\u0278\u027Ecy;\u4427PY\u803B\xA9\u40A9\u0180cpy\u015D\u0162\u017Aute;\u4106\u0100;i\u0167\u0168\u62D2talDifferentialD;\u6145leys;\u612D\u0200aeio\u0189\u018E\u0194\u0198ron;\u410Cdil\u803B\xC7\u40C7rc;\u4108nint;\u6230ot;\u410A\u0100dn\u01A7\u01ADilla;\u40B8terDot;\u40B7\xF2\u017Fi;\u43A7rcle\u0200DMPT\u01C7\u01CB\u01D1\u01D6ot;\u6299inus;\u6296lus;\u6295imes;\u6297o\u0100cs\u01E2\u01F8kwiseContourIntegral;\u6232eCurly\u0100DQ\u0203\u020FoubleQuote;\u601Duote;\u6019\u0200lnpu\u021E\u0228\u0247\u0255on\u0100;e\u0225\u0226\u6237;\u6A74\u0180git\u022F\u0236\u023Aruent;\u6261nt;\u622FourIntegral;\u622E\u0100fr\u024C\u024E;\u6102oduct;\u6210nterClockwiseContourIntegral;\u6233oss;\u6A2Fcr;\uC000\u{1D49E}p\u0100;C\u0284\u0285\u62D3ap;\u624D\u0580DJSZacefios\u02A0\u02AC\u02B0\u02B4\u02B8\u02CB\u02D7\u02E1\u02E6\u0333\u048D\u0100;o\u0179\u02A5trahd;\u6911cy;\u4402cy;\u4405cy;\u440F\u0180grs\u02BF\u02C4\u02C7ger;\u6021r;\u61A1hv;\u6AE4\u0100ay\u02D0\u02D5ron;\u410E;\u4414l\u0100;t\u02DD\u02DE\u6207a;\u4394r;\uC000\u{1D507}\u0100af\u02EB\u0327\u0100cm\u02F0\u0322ritical\u0200ADGT\u0300\u0306\u0316\u031Ccute;\u40B4o\u0174\u030B\u030D;\u42D9bleAcute;\u42DDrave;\u4060ilde;\u42DCond;\u62C4ferentialD;\u6146\u0470\u033D\\0\\0\\0\u0342\u0354\\0\u0405f;\uC000\u{1D53B}\u0180;DE\u0348\u0349\u034D\u40A8ot;\u60DCqual;\u6250ble\u0300CDLRUV\u0363\u0372\u0382\u03CF\u03E2\u03F8ontourIntegra\xEC\u0239o\u0274\u0379\\0\\0\u037B\xBB\u0349nArrow;\u61D3\u0100eo\u0387\u03A4ft\u0180ART\u0390\u0396\u03A1rrow;\u61D0ightArrow;\u61D4e\xE5\u02CAng\u0100LR\u03AB\u03C4eft\u0100AR\u03B3\u03B9rrow;\u67F8ightArrow;\u67FAightArrow;\u67F9ight\u0100AT\u03D8\u03DErrow;\u61D2ee;\u62A8p\u0241\u03E9\\0\\0\u03EFrrow;\u61D1ownArrow;\u61D5erticalBar;\u6225n\u0300ABLRTa\u0412\u042A\u0430\u045E\u047F\u037Crrow\u0180;BU\u041D\u041E\u0422\u6193ar;\u6913pArrow;\u61F5reve;\u4311eft\u02D2\u043A\\0\u0446\\0\u0450ightVector;\u6950eeVector;\u695Eector\u0100;B\u0459\u045A\u61BDar;\u6956ight\u01D4\u0467\\0\u0471eeVector;\u695Fector\u0100;B\u047A\u047B\u61C1ar;\u6957ee\u0100;A\u0486\u0487\u62A4rrow;\u61A7\u0100ct\u0492\u0497r;\uC000\u{1D49F}rok;\u4110\u0800NTacdfglmopqstux\u04BD\u04C0\u04C4\u04CB\u04DE\u04E2\u04E7\u04EE\u04F5\u0521\u052F\u0536\u0552\u055D\u0560\u0565G;\u414AH\u803B\xD0\u40D0cute\u803B\xC9\u40C9\u0180aiy\u04D2\u04D7\u04DCron;\u411Arc\u803B\xCA\u40CA;\u442Dot;\u4116r;\uC000\u{1D508}rave\u803B\xC8\u40C8ement;\u6208\u0100ap\u04FA\u04FEcr;\u4112ty\u0253\u0506\\0\\0\u0512mallSquare;\u65FBerySmallSquare;\u65AB\u0100gp\u0526\u052Aon;\u4118f;\uC000\u{1D53C}silon;\u4395u\u0100ai\u053C\u0549l\u0100;T\u0542\u0543\u6A75ilde;\u6242librium;\u61CC\u0100ci\u0557\u055Ar;\u6130m;\u6A73a;\u4397ml\u803B\xCB\u40CB\u0100ip\u056A\u056Fsts;\u6203onentialE;\u6147\u0280cfios\u0585\u0588\u058D\u05B2\u05CCy;\u4424r;\uC000\u{1D509}lled\u0253\u0597\\0\\0\u05A3mallSquare;\u65FCerySmallSquare;\u65AA\u0370\u05BA\\0\u05BF\\0\\0\u05C4f;\uC000\u{1D53D}All;\u6200riertrf;\u6131c\xF2\u05CB\u0600JTabcdfgorst\u05E8\u05EC\u05EF\u05FA\u0600\u0612\u0616\u061B\u061D\u0623\u066C\u0672cy;\u4403\u803B>\u403Emma\u0100;d\u05F7\u05F8\u4393;\u43DCreve;\u411E\u0180eiy\u0607\u060C\u0610dil;\u4122rc;\u411C;\u4413ot;\u4120r;\uC000\u{1D50A};\u62D9pf;\uC000\u{1D53E}eater\u0300EFGLST\u0635\u0644\u064E\u0656\u065B\u0666qual\u0100;L\u063E\u063F\u6265ess;\u62DBullEqual;\u6267reater;\u6AA2ess;\u6277lantEqual;\u6A7Eilde;\u6273cr;\uC000\u{1D4A2};\u626B\u0400Aacfiosu\u0685\u068B\u0696\u069B\u069E\u06AA\u06BE\u06CARDcy;\u442A\u0100ct\u0690\u0694ek;\u42C7;\u405Eirc;\u4124r;\u610ClbertSpace;\u610B\u01F0\u06AF\\0\u06B2f;\u610DizontalLine;\u6500\u0100ct\u06C3\u06C5\xF2\u06A9rok;\u4126mp\u0144\u06D0\u06D8ownHum\xF0\u012Fqual;\u624F\u0700EJOacdfgmnostu\u06FA\u06FE\u0703\u0707\u070E\u071A\u071E\u0721\u0728\u0744\u0778\u078B\u078F\u0795cy;\u4415lig;\u4132cy;\u4401cute\u803B\xCD\u40CD\u0100iy\u0713\u0718rc\u803B\xCE\u40CE;\u4418ot;\u4130r;\u6111rave\u803B\xCC\u40CC\u0180;ap\u0720\u072F\u073F\u0100cg\u0734\u0737r;\u412AinaryI;\u6148lie\xF3\u03DD\u01F4\u0749\\0\u0762\u0100;e\u074D\u074E\u622C\u0100gr\u0753\u0758ral;\u622Bsection;\u62C2isible\u0100CT\u076C\u0772omma;\u6063imes;\u6062\u0180gpt\u077F\u0783\u0788on;\u412Ef;\uC000\u{1D540}a;\u4399cr;\u6110ilde;\u4128\u01EB\u079A\\0\u079Ecy;\u4406l\u803B\xCF\u40CF\u0280cfosu\u07AC\u07B7\u07BC\u07C2\u07D0\u0100iy\u07B1\u07B5rc;\u4134;\u4419r;\uC000\u{1D50D}pf;\uC000\u{1D541}\u01E3\u07C7\\0\u07CCr;\uC000\u{1D4A5}rcy;\u4408kcy;\u4404\u0380HJacfos\u07E4\u07E8\u07EC\u07F1\u07FD\u0802\u0808cy;\u4425cy;\u440Cppa;\u439A\u0100ey\u07F6\u07FBdil;\u4136;\u441Ar;\uC000\u{1D50E}pf;\uC000\u{1D542}cr;\uC000\u{1D4A6}\u0580JTaceflmost\u0825\u0829\u082C\u0850\u0863\u09B3\u09B8\u09C7\u09CD\u0A37\u0A47cy;\u4409\u803B<\u403C\u0280cmnpr\u0837\u083C\u0841\u0844\u084Dute;\u4139bda;\u439Bg;\u67EAlacetrf;\u6112r;\u619E\u0180aey\u0857\u085C\u0861ron;\u413Ddil;\u413B;\u441B\u0100fs\u0868\u0970t\u0500ACDFRTUVar\u087E\u08A9\u08B1\u08E0\u08E6\u08FC\u092F\u095B\u0390\u096A\u0100nr\u0883\u088FgleBracket;\u67E8row\u0180;BR\u0899\u089A\u089E\u6190ar;\u61E4ightArrow;\u61C6eiling;\u6308o\u01F5\u08B7\\0\u08C3bleBracket;\u67E6n\u01D4\u08C8\\0\u08D2eeVector;\u6961ector\u0100;B\u08DB\u08DC\u61C3ar;\u6959loor;\u630Aight\u0100AV\u08EF\u08F5rrow;\u6194ector;\u694E\u0100er\u0901\u0917e\u0180;AV\u0909\u090A\u0910\u62A3rrow;\u61A4ector;\u695Aiangle\u0180;BE\u0924\u0925\u0929\u62B2ar;\u69CFqual;\u62B4p\u0180DTV\u0937\u0942\u094CownVector;\u6951eeVector;\u6960ector\u0100;B\u0956\u0957\u61BFar;\u6958ector\u0100;B\u0965\u0966\u61BCar;\u6952ight\xE1\u039Cs\u0300EFGLST\u097E\u098B\u0995\u099D\u09A2\u09ADqualGreater;\u62DAullEqual;\u6266reater;\u6276ess;\u6AA1lantEqual;\u6A7Dilde;\u6272r;\uC000\u{1D50F}\u0100;e\u09BD\u09BE\u62D8ftarrow;\u61DAidot;\u413F\u0180npw\u09D4\u0A16\u0A1Bg\u0200LRlr\u09DE\u09F7\u0A02\u0A10eft\u0100AR\u09E6\u09ECrrow;\u67F5ightArrow;\u67F7ightArrow;\u67F6eft\u0100ar\u03B3\u0A0Aight\xE1\u03BFight\xE1\u03CAf;\uC000\u{1D543}er\u0100LR\u0A22\u0A2CeftArrow;\u6199ightArrow;\u6198\u0180cht\u0A3E\u0A40\u0A42\xF2\u084C;\u61B0rok;\u4141;\u626A\u0400acefiosu\u0A5A\u0A5D\u0A60\u0A77\u0A7C\u0A85\u0A8B\u0A8Ep;\u6905y;\u441C\u0100dl\u0A65\u0A6FiumSpace;\u605Flintrf;\u6133r;\uC000\u{1D510}nusPlus;\u6213pf;\uC000\u{1D544}c\xF2\u0A76;\u439C\u0480Jacefostu\u0AA3\u0AA7\u0AAD\u0AC0\u0B14\u0B19\u0D91\u0D97\u0D9Ecy;\u440Acute;\u4143\u0180aey\u0AB4\u0AB9\u0ABEron;\u4147dil;\u4145;\u441D\u0180gsw\u0AC7\u0AF0\u0B0Eative\u0180MTV\u0AD3\u0ADF\u0AE8ediumSpace;\u600Bhi\u0100cn\u0AE6\u0AD8\xEB\u0AD9eryThi\xEE\u0AD9ted\u0100GL\u0AF8\u0B06reaterGreate\xF2\u0673essLes\xF3\u0A48Line;\u400Ar;\uC000\u{1D511}\u0200Bnpt\u0B22\u0B28\u0B37\u0B3Areak;\u6060BreakingSpace;\u40A0f;\u6115\u0680;CDEGHLNPRSTV\u0B55\u0B56\u0B6A\u0B7C\u0BA1\u0BEB\u0C04\u0C5E\u0C84\u0CA6\u0CD8\u0D61\u0D85\u6AEC\u0100ou\u0B5B\u0B64ngruent;\u6262pCap;\u626DoubleVerticalBar;\u6226\u0180lqx\u0B83\u0B8A\u0B9Bement;\u6209ual\u0100;T\u0B92\u0B93\u6260ilde;\uC000\u2242\u0338ists;\u6204reater\u0380;EFGLST\u0BB6\u0BB7\u0BBD\u0BC9\u0BD3\u0BD8\u0BE5\u626Fqual;\u6271ullEqual;\uC000\u2267\u0338reater;\uC000\u226B\u0338ess;\u6279lantEqual;\uC000\u2A7E\u0338ilde;\u6275ump\u0144\u0BF2\u0BFDownHump;\uC000\u224E\u0338qual;\uC000\u224F\u0338e\u0100fs\u0C0A\u0C27tTriangle\u0180;BE\u0C1A\u0C1B\u0C21\u62EAar;\uC000\u29CF\u0338qual;\u62ECs\u0300;EGLST\u0C35\u0C36\u0C3C\u0C44\u0C4B\u0C58\u626Equal;\u6270reater;\u6278ess;\uC000\u226A\u0338lantEqual;\uC000\u2A7D\u0338ilde;\u6274ested\u0100GL\u0C68\u0C79reaterGreater;\uC000\u2AA2\u0338essLess;\uC000\u2AA1\u0338recedes\u0180;ES\u0C92\u0C93\u0C9B\u6280qual;\uC000\u2AAF\u0338lantEqual;\u62E0\u0100ei\u0CAB\u0CB9verseElement;\u620CghtTriangle\u0180;BE\u0CCB\u0CCC\u0CD2\u62EBar;\uC000\u29D0\u0338qual;\u62ED\u0100qu\u0CDD\u0D0CuareSu\u0100bp\u0CE8\u0CF9set\u0100;E\u0CF0\u0CF3\uC000\u228F\u0338qual;\u62E2erset\u0100;E\u0D03\u0D06\uC000\u2290\u0338qual;\u62E3\u0180bcp\u0D13\u0D24\u0D4Eset\u0100;E\u0D1B\u0D1E\uC000\u2282\u20D2qual;\u6288ceeds\u0200;EST\u0D32\u0D33\u0D3B\u0D46\u6281qual;\uC000\u2AB0\u0338lantEqual;\u62E1ilde;\uC000\u227F\u0338erset\u0100;E\u0D58\u0D5B\uC000\u2283\u20D2qual;\u6289ilde\u0200;EFT\u0D6E\u0D6F\u0D75\u0D7F\u6241qual;\u6244ullEqual;\u6247ilde;\u6249erticalBar;\u6224cr;\uC000\u{1D4A9}ilde\u803B\xD1\u40D1;\u439D\u0700Eacdfgmoprstuv\u0DBD\u0DC2\u0DC9\u0DD5\u0DDB\u0DE0\u0DE7\u0DFC\u0E02\u0E20\u0E22\u0E32\u0E3F\u0E44lig;\u4152cute\u803B\xD3\u40D3\u0100iy\u0DCE\u0DD3rc\u803B\xD4\u40D4;\u441Eblac;\u4150r;\uC000\u{1D512}rave\u803B\xD2\u40D2\u0180aei\u0DEE\u0DF2\u0DF6cr;\u414Cga;\u43A9cron;\u439Fpf;\uC000\u{1D546}enCurly\u0100DQ\u0E0E\u0E1AoubleQuote;\u601Cuote;\u6018;\u6A54\u0100cl\u0E27\u0E2Cr;\uC000\u{1D4AA}ash\u803B\xD8\u40D8i\u016C\u0E37\u0E3Cde\u803B\xD5\u40D5es;\u6A37ml\u803B\xD6\u40D6er\u0100BP\u0E4B\u0E60\u0100ar\u0E50\u0E53r;\u603Eac\u0100ek\u0E5A\u0E5C;\u63DEet;\u63B4arenthesis;\u63DC\u0480acfhilors\u0E7F\u0E87\u0E8A\u0E8F\u0E92\u0E94\u0E9D\u0EB0\u0EFCrtialD;\u6202y;\u441Fr;\uC000\u{1D513}i;\u43A6;\u43A0usMinus;\u40B1\u0100ip\u0EA2\u0EADncareplan\xE5\u069Df;\u6119\u0200;eio\u0EB9\u0EBA\u0EE0\u0EE4\u6ABBcedes\u0200;EST\u0EC8\u0EC9\u0ECF\u0EDA\u627Aqual;\u6AAFlantEqual;\u627Cilde;\u627Eme;\u6033\u0100dp\u0EE9\u0EEEuct;\u620Fortion\u0100;a\u0225\u0EF9l;\u621D\u0100ci\u0F01\u0F06r;\uC000\u{1D4AB};\u43A8\u0200Ufos\u0F11\u0F16\u0F1B\u0F1FOT\u803B"\u4022r;\uC000\u{1D514}pf;\u611Acr;\uC000\u{1D4AC}\u0600BEacefhiorsu\u0F3E\u0F43\u0F47\u0F60\u0F73\u0FA7\u0FAA\u0FAD\u1096\u10A9\u10B4\u10BEarr;\u6910G\u803B\xAE\u40AE\u0180cnr\u0F4E\u0F53\u0F56ute;\u4154g;\u67EBr\u0100;t\u0F5C\u0F5D\u61A0l;\u6916\u0180aey\u0F67\u0F6C\u0F71ron;\u4158dil;\u4156;\u4420\u0100;v\u0F78\u0F79\u611Cerse\u0100EU\u0F82\u0F99\u0100lq\u0F87\u0F8Eement;\u620Builibrium;\u61CBpEquilibrium;\u696Fr\xBB\u0F79o;\u43A1ght\u0400ACDFTUVa\u0FC1\u0FEB\u0FF3\u1022\u1028\u105B\u1087\u03D8\u0100nr\u0FC6\u0FD2gleBracket;\u67E9row\u0180;BL\u0FDC\u0FDD\u0FE1\u6192ar;\u61E5eftArrow;\u61C4eiling;\u6309o\u01F5\u0FF9\\0\u1005bleBracket;\u67E7n\u01D4\u100A\\0\u1014eeVector;\u695Dector\u0100;B\u101D\u101E\u61C2ar;\u6955loor;\u630B\u0100er\u102D\u1043e\u0180;AV\u1035\u1036\u103C\u62A2rrow;\u61A6ector;\u695Biangle\u0180;BE\u1050\u1051\u1055\u62B3ar;\u69D0qual;\u62B5p\u0180DTV\u1063\u106E\u1078ownVector;\u694FeeVector;\u695Cector\u0100;B\u1082\u1083\u61BEar;\u6954ector\u0100;B\u1091\u1092\u61C0ar;\u6953\u0100pu\u109B\u109Ef;\u611DndImplies;\u6970ightarrow;\u61DB\u0100ch\u10B9\u10BCr;\u611B;\u61B1leDelayed;\u69F4\u0680HOacfhimoqstu\u10E4\u10F1\u10F7\u10FD\u1119\u111E\u1151\u1156\u1161\u1167\u11B5\u11BB\u11BF\u0100Cc\u10E9\u10EEHcy;\u4429y;\u4428FTcy;\u442Ccute;\u415A\u0280;aeiy\u1108\u1109\u110E\u1113\u1117\u6ABCron;\u4160dil;\u415Erc;\u415C;\u4421r;\uC000\u{1D516}ort\u0200DLRU\u112A\u1134\u113E\u1149ownArrow\xBB\u041EeftArrow\xBB\u089AightArrow\xBB\u0FDDpArrow;\u6191gma;\u43A3allCircle;\u6218pf;\uC000\u{1D54A}\u0272\u116D\\0\\0\u1170t;\u621Aare\u0200;ISU\u117B\u117C\u1189\u11AF\u65A1ntersection;\u6293u\u0100bp\u118F\u119Eset\u0100;E\u1197\u1198\u628Fqual;\u6291erset\u0100;E\u11A8\u11A9\u6290qual;\u6292nion;\u6294cr;\uC000\u{1D4AE}ar;\u62C6\u0200bcmp\u11C8\u11DB\u1209\u120B\u0100;s\u11CD\u11CE\u62D0et\u0100;E\u11CD\u11D5qual;\u6286\u0100ch\u11E0\u1205eeds\u0200;EST\u11ED\u11EE\u11F4\u11FF\u627Bqual;\u6AB0lantEqual;\u627Dilde;\u627FTh\xE1\u0F8C;\u6211\u0180;es\u1212\u1213\u1223\u62D1rset\u0100;E\u121C\u121D\u6283qual;\u6287et\xBB\u1213\u0580HRSacfhiors\u123E\u1244\u1249\u1255\u125E\u1271\u1276\u129F\u12C2\u12C8\u12D1ORN\u803B\xDE\u40DEADE;\u6122\u0100Hc\u124E\u1252cy;\u440By;\u4426\u0100bu\u125A\u125C;\u4009;\u43A4\u0180aey\u1265\u126A\u126Fron;\u4164dil;\u4162;\u4422r;\uC000\u{1D517}\u0100ei\u127B\u1289\u01F2\u1280\\0\u1287efore;\u6234a;\u4398\u0100cn\u128E\u1298kSpace;\uC000\u205F\u200ASpace;\u6009lde\u0200;EFT\u12AB\u12AC\u12B2\u12BC\u623Cqual;\u6243ullEqual;\u6245ilde;\u6248pf;\uC000\u{1D54B}ipleDot;\u60DB\u0100ct\u12D6\u12DBr;\uC000\u{1D4AF}rok;\u4166\u0AE1\u12F7\u130E\u131A\u1326\\0\u132C\u1331\\0\\0\\0\\0\\0\u1338\u133D\u1377\u1385\\0\u13FF\u1404\u140A\u1410\u0100cr\u12FB\u1301ute\u803B\xDA\u40DAr\u0100;o\u1307\u1308\u619Fcir;\u6949r\u01E3\u1313\\0\u1316y;\u440Eve;\u416C\u0100iy\u131E\u1323rc\u803B\xDB\u40DB;\u4423blac;\u4170r;\uC000\u{1D518}rave\u803B\xD9\u40D9acr;\u416A\u0100di\u1341\u1369er\u0100BP\u1348\u135D\u0100ar\u134D\u1350r;\u405Fac\u0100ek\u1357\u1359;\u63DFet;\u63B5arenthesis;\u63DDon\u0100;P\u1370\u1371\u62C3lus;\u628E\u0100gp\u137B\u137Fon;\u4172f;\uC000\u{1D54C}\u0400ADETadps\u1395\u13AE\u13B8\u13C4\u03E8\u13D2\u13D7\u13F3rrow\u0180;BD\u1150\u13A0\u13A4ar;\u6912ownArrow;\u61C5ownArrow;\u6195quilibrium;\u696Eee\u0100;A\u13CB\u13CC\u62A5rrow;\u61A5own\xE1\u03F3er\u0100LR\u13DE\u13E8eftArrow;\u6196ightArrow;\u6197i\u0100;l\u13F9\u13FA\u43D2on;\u43A5ing;\u416Ecr;\uC000\u{1D4B0}ilde;\u4168ml\u803B\xDC\u40DC\u0480Dbcdefosv\u1427\u142C\u1430\u1433\u143E\u1485\u148A\u1490\u1496ash;\u62ABar;\u6AEBy;\u4412ash\u0100;l\u143B\u143C\u62A9;\u6AE6\u0100er\u1443\u1445;\u62C1\u0180bty\u144C\u1450\u147Aar;\u6016\u0100;i\u144F\u1455cal\u0200BLST\u1461\u1465\u146A\u1474ar;\u6223ine;\u407Ceparator;\u6758ilde;\u6240ThinSpace;\u600Ar;\uC000\u{1D519}pf;\uC000\u{1D54D}cr;\uC000\u{1D4B1}dash;\u62AA\u0280cefos\u14A7\u14AC\u14B1\u14B6\u14BCirc;\u4174dge;\u62C0r;\uC000\u{1D51A}pf;\uC000\u{1D54E}cr;\uC000\u{1D4B2}\u0200fios\u14CB\u14D0\u14D2\u14D8r;\uC000\u{1D51B};\u439Epf;\uC000\u{1D54F}cr;\uC000\u{1D4B3}\u0480AIUacfosu\u14F1\u14F5\u14F9\u14FD\u1504\u150F\u1514\u151A\u1520cy;\u442Fcy;\u4407cy;\u442Ecute\u803B\xDD\u40DD\u0100iy\u1509\u150Drc;\u4176;\u442Br;\uC000\u{1D51C}pf;\uC000\u{1D550}cr;\uC000\u{1D4B4}ml;\u4178\u0400Hacdefos\u1535\u1539\u153F\u154B\u154F\u155D\u1560\u1564cy;\u4416cute;\u4179\u0100ay\u1544\u1549ron;\u417D;\u4417ot;\u417B\u01F2\u1554\\0\u155BoWidt\xE8\u0AD9a;\u4396r;\u6128pf;\u6124cr;\uC000\u{1D4B5}\u0BE1\u1583\u158A\u1590\\0\u15B0\u15B6\u15BF\\0\\0\\0\\0\u15C6\u15DB\u15EB\u165F\u166D\\0\u1695\u169B\u16B2\u16B9\\0\u16BEcute\u803B\xE1\u40E1reve;\u4103\u0300;Ediuy\u159C\u159D\u15A1\u15A3\u15A8\u15AD\u623E;\uC000\u223E\u0333;\u623Frc\u803B\xE2\u40E2te\u80BB\xB4\u0306;\u4430lig\u803B\xE6\u40E6\u0100;r\xB2\u15BA;\uC000\u{1D51E}rave\u803B\xE0\u40E0\u0100ep\u15CA\u15D6\u0100fp\u15CF\u15D4sym;\u6135\xE8\u15D3ha;\u43B1\u0100ap\u15DFc\u0100cl\u15E4\u15E7r;\u4101g;\u6A3F\u0264\u15F0\\0\\0\u160A\u0280;adsv\u15FA\u15FB\u15FF\u1601\u1607\u6227nd;\u6A55;\u6A5Clope;\u6A58;\u6A5A\u0380;elmrsz\u1618\u1619\u161B\u161E\u163F\u164F\u1659\u6220;\u69A4e\xBB\u1619sd\u0100;a\u1625\u1626\u6221\u0461\u1630\u1632\u1634\u1636\u1638\u163A\u163C\u163E;\u69A8;\u69A9;\u69AA;\u69AB;\u69AC;\u69AD;\u69AE;\u69AFt\u0100;v\u1645\u1646\u621Fb\u0100;d\u164C\u164D\u62BE;\u699D\u0100pt\u1654\u1657h;\u6222\xBB\xB9arr;\u637C\u0100gp\u1663\u1667on;\u4105f;\uC000\u{1D552}\u0380;Eaeiop\u12C1\u167B\u167D\u1682\u1684\u1687\u168A;\u6A70cir;\u6A6F;\u624Ad;\u624Bs;\u4027rox\u0100;e\u12C1\u1692\xF1\u1683ing\u803B\xE5\u40E5\u0180cty\u16A1\u16A6\u16A8r;\uC000\u{1D4B6};\u402Amp\u0100;e\u12C1\u16AF\xF1\u0288ilde\u803B\xE3\u40E3ml\u803B\xE4\u40E4\u0100ci\u16C2\u16C8onin\xF4\u0272nt;\u6A11\u0800Nabcdefiklnoprsu\u16ED\u16F1\u1730\u173C\u1743\u1748\u1778\u177D\u17E0\u17E6\u1839\u1850\u170D\u193D\u1948\u1970ot;\u6AED\u0100cr\u16F6\u171Ek\u0200ceps\u1700\u1705\u170D\u1713ong;\u624Cpsilon;\u43F6rime;\u6035im\u0100;e\u171A\u171B\u623Dq;\u62CD\u0176\u1722\u1726ee;\u62BDed\u0100;g\u172C\u172D\u6305e\xBB\u172Drk\u0100;t\u135C\u1737brk;\u63B6\u0100oy\u1701\u1741;\u4431quo;\u601E\u0280cmprt\u1753\u175B\u1761\u1764\u1768aus\u0100;e\u010A\u0109ptyv;\u69B0s\xE9\u170Cno\xF5\u0113\u0180ahw\u176F\u1771\u1773;\u43B2;\u6136een;\u626Cr;\uC000\u{1D51F}g\u0380costuvw\u178D\u179D\u17B3\u17C1\u17D5\u17DB\u17DE\u0180aiu\u1794\u1796\u179A\xF0\u0760rc;\u65EFp\xBB\u1371\u0180dpt\u17A4\u17A8\u17ADot;\u6A00lus;\u6A01imes;\u6A02\u0271\u17B9\\0\\0\u17BEcup;\u6A06ar;\u6605riangle\u0100du\u17CD\u17D2own;\u65BDp;\u65B3plus;\u6A04e\xE5\u1444\xE5\u14ADarow;\u690D\u0180ako\u17ED\u1826\u1835\u0100cn\u17F2\u1823k\u0180lst\u17FA\u05AB\u1802ozenge;\u69EBriangle\u0200;dlr\u1812\u1813\u1818\u181D\u65B4own;\u65BEeft;\u65C2ight;\u65B8k;\u6423\u01B1\u182B\\0\u1833\u01B2\u182F\\0\u1831;\u6592;\u65914;\u6593ck;\u6588\u0100eo\u183E\u184D\u0100;q\u1843\u1846\uC000=\u20E5uiv;\uC000\u2261\u20E5t;\u6310\u0200ptwx\u1859\u185E\u1867\u186Cf;\uC000\u{1D553}\u0100;t\u13CB\u1863om\xBB\u13CCtie;\u62C8\u0600DHUVbdhmptuv\u1885\u1896\u18AA\u18BB\u18D7\u18DB\u18EC\u18FF\u1905\u190A\u1910\u1921\u0200LRlr\u188E\u1890\u1892\u1894;\u6557;\u6554;\u6556;\u6553\u0280;DUdu\u18A1\u18A2\u18A4\u18A6\u18A8\u6550;\u6566;\u6569;\u6564;\u6567\u0200LRlr\u18B3\u18B5\u18B7\u18B9;\u655D;\u655A;\u655C;\u6559\u0380;HLRhlr\u18CA\u18CB\u18CD\u18CF\u18D1\u18D3\u18D5\u6551;\u656C;\u6563;\u6560;\u656B;\u6562;\u655Fox;\u69C9\u0200LRlr\u18E4\u18E6\u18E8\u18EA;\u6555;\u6552;\u6510;\u650C\u0280;DUdu\u06BD\u18F7\u18F9\u18FB\u18FD;\u6565;\u6568;\u652C;\u6534inus;\u629Flus;\u629Eimes;\u62A0\u0200LRlr\u1919\u191B\u191D\u191F;\u655B;\u6558;\u6518;\u6514\u0380;HLRhlr\u1930\u1931\u1933\u1935\u1937\u1939\u193B\u6502;\u656A;\u6561;\u655E;\u653C;\u6524;\u651C\u0100ev\u0123\u1942bar\u803B\xA6\u40A6\u0200ceio\u1951\u1956\u195A\u1960r;\uC000\u{1D4B7}mi;\u604Fm\u0100;e\u171A\u171Cl\u0180;bh\u1968\u1969\u196B\u405C;\u69C5sub;\u67C8\u016C\u1974\u197El\u0100;e\u1979\u197A\u6022t\xBB\u197Ap\u0180;Ee\u012F\u1985\u1987;\u6AAE\u0100;q\u06DC\u06DB\u0CE1\u19A7\\0\u19E8\u1A11\u1A15\u1A32\\0\u1A37\u1A50\\0\\0\u1AB4\\0\\0\u1AC1\\0\\0\u1B21\u1B2E\u1B4D\u1B52\\0\u1BFD\\0\u1C0C\u0180cpr\u19AD\u19B2\u19DDute;\u4107\u0300;abcds\u19BF\u19C0\u19C4\u19CA\u19D5\u19D9\u6229nd;\u6A44rcup;\u6A49\u0100au\u19CF\u19D2p;\u6A4Bp;\u6A47ot;\u6A40;\uC000\u2229\uFE00\u0100eo\u19E2\u19E5t;\u6041\xEE\u0693\u0200aeiu\u19F0\u19FB\u1A01\u1A05\u01F0\u19F5\\0\u19F8s;\u6A4Don;\u410Ddil\u803B\xE7\u40E7rc;\u4109ps\u0100;s\u1A0C\u1A0D\u6A4Cm;\u6A50ot;\u410B\u0180dmn\u1A1B\u1A20\u1A26il\u80BB\xB8\u01ADptyv;\u69B2t\u8100\xA2;e\u1A2D\u1A2E\u40A2r\xE4\u01B2r;\uC000\u{1D520}\u0180cei\u1A3D\u1A40\u1A4Dy;\u4447ck\u0100;m\u1A47\u1A48\u6713ark\xBB\u1A48;\u43C7r\u0380;Ecefms\u1A5F\u1A60\u1A62\u1A6B\u1AA4\u1AAA\u1AAE\u65CB;\u69C3\u0180;el\u1A69\u1A6A\u1A6D\u42C6q;\u6257e\u0261\u1A74\\0\\0\u1A88rrow\u0100lr\u1A7C\u1A81eft;\u61BAight;\u61BB\u0280RSacd\u1A92\u1A94\u1A96\u1A9A\u1A9F\xBB\u0F47;\u64C8st;\u629Birc;\u629Aash;\u629Dnint;\u6A10id;\u6AEFcir;\u69C2ubs\u0100;u\u1ABB\u1ABC\u6663it\xBB\u1ABC\u02EC\u1AC7\u1AD4\u1AFA\\0\u1B0Aon\u0100;e\u1ACD\u1ACE\u403A\u0100;q\xC7\xC6\u026D\u1AD9\\0\\0\u1AE2a\u0100;t\u1ADE\u1ADF\u402C;\u4040\u0180;fl\u1AE8\u1AE9\u1AEB\u6201\xEE\u1160e\u0100mx\u1AF1\u1AF6ent\xBB\u1AE9e\xF3\u024D\u01E7\u1AFE\\0\u1B07\u0100;d\u12BB\u1B02ot;\u6A6Dn\xF4\u0246\u0180fry\u1B10\u1B14\u1B17;\uC000\u{1D554}o\xE4\u0254\u8100\xA9;s\u0155\u1B1Dr;\u6117\u0100ao\u1B25\u1B29rr;\u61B5ss;\u6717\u0100cu\u1B32\u1B37r;\uC000\u{1D4B8}\u0100bp\u1B3C\u1B44\u0100;e\u1B41\u1B42\u6ACF;\u6AD1\u0100;e\u1B49\u1B4A\u6AD0;\u6AD2dot;\u62EF\u0380delprvw\u1B60\u1B6C\u1B77\u1B82\u1BAC\u1BD4\u1BF9arr\u0100lr\u1B68\u1B6A;\u6938;\u6935\u0270\u1B72\\0\\0\u1B75r;\u62DEc;\u62DFarr\u0100;p\u1B7F\u1B80\u61B6;\u693D\u0300;bcdos\u1B8F\u1B90\u1B96\u1BA1\u1BA5\u1BA8\u622Arcap;\u6A48\u0100au\u1B9B\u1B9Ep;\u6A46p;\u6A4Aot;\u628Dr;\u6A45;\uC000\u222A\uFE00\u0200alrv\u1BB5\u1BBF\u1BDE\u1BE3rr\u0100;m\u1BBC\u1BBD\u61B7;\u693Cy\u0180evw\u1BC7\u1BD4\u1BD8q\u0270\u1BCE\\0\\0\u1BD2re\xE3\u1B73u\xE3\u1B75ee;\u62CEedge;\u62CFen\u803B\xA4\u40A4earrow\u0100lr\u1BEE\u1BF3eft\xBB\u1B80ight\xBB\u1BBDe\xE4\u1BDD\u0100ci\u1C01\u1C07onin\xF4\u01F7nt;\u6231lcty;\u632D\u0980AHabcdefhijlorstuwz\u1C38\u1C3B\u1C3F\u1C5D\u1C69\u1C75\u1C8A\u1C9E\u1CAC\u1CB7\u1CFB\u1CFF\u1D0D\u1D7B\u1D91\u1DAB\u1DBB\u1DC6\u1DCDr\xF2\u0381ar;\u6965\u0200glrs\u1C48\u1C4D\u1C52\u1C54ger;\u6020eth;\u6138\xF2\u1133h\u0100;v\u1C5A\u1C5B\u6010\xBB\u090A\u016B\u1C61\u1C67arow;\u690Fa\xE3\u0315\u0100ay\u1C6E\u1C73ron;\u410F;\u4434\u0180;ao\u0332\u1C7C\u1C84\u0100gr\u02BF\u1C81r;\u61CAtseq;\u6A77\u0180glm\u1C91\u1C94\u1C98\u803B\xB0\u40B0ta;\u43B4ptyv;\u69B1\u0100ir\u1CA3\u1CA8sht;\u697F;\uC000\u{1D521}ar\u0100lr\u1CB3\u1CB5\xBB\u08DC\xBB\u101E\u0280aegsv\u1CC2\u0378\u1CD6\u1CDC\u1CE0m\u0180;os\u0326\u1CCA\u1CD4nd\u0100;s\u0326\u1CD1uit;\u6666amma;\u43DDin;\u62F2\u0180;io\u1CE7\u1CE8\u1CF8\u40F7de\u8100\xF7;o\u1CE7\u1CF0ntimes;\u62C7n\xF8\u1CF7cy;\u4452c\u026F\u1D06\\0\\0\u1D0Arn;\u631Eop;\u630D\u0280lptuw\u1D18\u1D1D\u1D22\u1D49\u1D55lar;\u4024f;\uC000\u{1D555}\u0280;emps\u030B\u1D2D\u1D37\u1D3D\u1D42q\u0100;d\u0352\u1D33ot;\u6251inus;\u6238lus;\u6214quare;\u62A1blebarwedg\xE5\xFAn\u0180adh\u112E\u1D5D\u1D67ownarrow\xF3\u1C83arpoon\u0100lr\u1D72\u1D76ef\xF4\u1CB4igh\xF4\u1CB6\u0162\u1D7F\u1D85karo\xF7\u0F42\u026F\u1D8A\\0\\0\u1D8Ern;\u631Fop;\u630C\u0180cot\u1D98\u1DA3\u1DA6\u0100ry\u1D9D\u1DA1;\uC000\u{1D4B9};\u4455l;\u69F6rok;\u4111\u0100dr\u1DB0\u1DB4ot;\u62F1i\u0100;f\u1DBA\u1816\u65BF\u0100ah\u1DC0\u1DC3r\xF2\u0429a\xF2\u0FA6angle;\u69A6\u0100ci\u1DD2\u1DD5y;\u445Fgrarr;\u67FF\u0900Dacdefglmnopqrstux\u1E01\u1E09\u1E19\u1E38\u0578\u1E3C\u1E49\u1E61\u1E7E\u1EA5\u1EAF\u1EBD\u1EE1\u1F2A\u1F37\u1F44\u1F4E\u1F5A\u0100Do\u1E06\u1D34o\xF4\u1C89\u0100cs\u1E0E\u1E14ute\u803B\xE9\u40E9ter;\u6A6E\u0200aioy\u1E22\u1E27\u1E31\u1E36ron;\u411Br\u0100;c\u1E2D\u1E2E\u6256\u803B\xEA\u40EAlon;\u6255;\u444Dot;\u4117\u0100Dr\u1E41\u1E45ot;\u6252;\uC000\u{1D522}\u0180;rs\u1E50\u1E51\u1E57\u6A9Aave\u803B\xE8\u40E8\u0100;d\u1E5C\u1E5D\u6A96ot;\u6A98\u0200;ils\u1E6A\u1E6B\u1E72\u1E74\u6A99nters;\u63E7;\u6113\u0100;d\u1E79\u1E7A\u6A95ot;\u6A97\u0180aps\u1E85\u1E89\u1E97cr;\u4113ty\u0180;sv\u1E92\u1E93\u1E95\u6205et\xBB\u1E93p\u01001;\u1E9D\u1EA4\u0133\u1EA1\u1EA3;\u6004;\u6005\u6003\u0100gs\u1EAA\u1EAC;\u414Bp;\u6002\u0100gp\u1EB4\u1EB8on;\u4119f;\uC000\u{1D556}\u0180als\u1EC4\u1ECE\u1ED2r\u0100;s\u1ECA\u1ECB\u62D5l;\u69E3us;\u6A71i\u0180;lv\u1EDA\u1EDB\u1EDF\u43B5on\xBB\u1EDB;\u43F5\u0200csuv\u1EEA\u1EF3\u1F0B\u1F23\u0100io\u1EEF\u1E31rc\xBB\u1E2E\u0269\u1EF9\\0\\0\u1EFB\xED\u0548ant\u0100gl\u1F02\u1F06tr\xBB\u1E5Dess\xBB\u1E7A\u0180aei\u1F12\u1F16\u1F1Als;\u403Dst;\u625Fv\u0100;D\u0235\u1F20D;\u6A78parsl;\u69E5\u0100Da\u1F2F\u1F33ot;\u6253rr;\u6971\u0180cdi\u1F3E\u1F41\u1EF8r;\u612Fo\xF4\u0352\u0100ah\u1F49\u1F4B;\u43B7\u803B\xF0\u40F0\u0100mr\u1F53\u1F57l\u803B\xEB\u40EBo;\u60AC\u0180cip\u1F61\u1F64\u1F67l;\u4021s\xF4\u056E\u0100eo\u1F6C\u1F74ctatio\xEE\u0559nential\xE5\u0579\u09E1\u1F92\\0\u1F9E\\0\u1FA1\u1FA7\\0\\0\u1FC6\u1FCC\\0\u1FD3\\0\u1FE6\u1FEA\u2000\\0\u2008\u205Allingdotse\xF1\u1E44y;\u4444male;\u6640\u0180ilr\u1FAD\u1FB3\u1FC1lig;\u8000\uFB03\u0269\u1FB9\\0\\0\u1FBDg;\u8000\uFB00ig;\u8000\uFB04;\uC000\u{1D523}lig;\u8000\uFB01lig;\uC000fj\u0180alt\u1FD9\u1FDC\u1FE1t;\u666Dig;\u8000\uFB02ns;\u65B1of;\u4192\u01F0\u1FEE\\0\u1FF3f;\uC000\u{1D557}\u0100ak\u05BF\u1FF7\u0100;v\u1FFC\u1FFD\u62D4;\u6AD9artint;\u6A0D\u0100ao\u200C\u2055\u0100cs\u2011\u2052\u03B1\u201A\u2030\u2038\u2045\u2048\\0\u2050\u03B2\u2022\u2025\u2027\u202A\u202C\\0\u202E\u803B\xBD\u40BD;\u6153\u803B\xBC\u40BC;\u6155;\u6159;\u615B\u01B3\u2034\\0\u2036;\u6154;\u6156\u02B4\u203E\u2041\\0\\0\u2043\u803B\xBE\u40BE;\u6157;\u615C5;\u6158\u01B6\u204C\\0\u204E;\u615A;\u615D8;\u615El;\u6044wn;\u6322cr;\uC000\u{1D4BB}\u0880Eabcdefgijlnorstv\u2082\u2089\u209F\u20A5\u20B0\u20B4\u20F0\u20F5\u20FA\u20FF\u2103\u2112\u2138\u0317\u213E\u2152\u219E\u0100;l\u064D\u2087;\u6A8C\u0180cmp\u2090\u2095\u209Dute;\u41F5ma\u0100;d\u209C\u1CDA\u43B3;\u6A86reve;\u411F\u0100iy\u20AA\u20AErc;\u411D;\u4433ot;\u4121\u0200;lqs\u063E\u0642\u20BD\u20C9\u0180;qs\u063E\u064C\u20C4lan\xF4\u0665\u0200;cdl\u0665\u20D2\u20D5\u20E5c;\u6AA9ot\u0100;o\u20DC\u20DD\u6A80\u0100;l\u20E2\u20E3\u6A82;\u6A84\u0100;e\u20EA\u20ED\uC000\u22DB\uFE00s;\u6A94r;\uC000\u{1D524}\u0100;g\u0673\u061Bmel;\u6137cy;\u4453\u0200;Eaj\u065A\u210C\u210E\u2110;\u6A92;\u6AA5;\u6AA4\u0200Eaes\u211B\u211D\u2129\u2134;\u6269p\u0100;p\u2123\u2124\u6A8Arox\xBB\u2124\u0100;q\u212E\u212F\u6A88\u0100;q\u212E\u211Bim;\u62E7pf;\uC000\u{1D558}\u0100ci\u2143\u2146r;\u610Am\u0180;el\u066B\u214E\u2150;\u6A8E;\u6A90\u8300>;cdlqr\u05EE\u2160\u216A\u216E\u2173\u2179\u0100ci\u2165\u2167;\u6AA7r;\u6A7Aot;\u62D7Par;\u6995uest;\u6A7C\u0280adels\u2184\u216A\u2190\u0656\u219B\u01F0\u2189\\0\u218Epro\xF8\u209Er;\u6978q\u0100lq\u063F\u2196les\xF3\u2088i\xED\u066B\u0100en\u21A3\u21ADrtneqq;\uC000\u2269\uFE00\xC5\u21AA\u0500Aabcefkosy\u21C4\u21C7\u21F1\u21F5\u21FA\u2218\u221D\u222F\u2268\u227Dr\xF2\u03A0\u0200ilmr\u21D0\u21D4\u21D7\u21DBrs\xF0\u1484f\xBB\u2024il\xF4\u06A9\u0100dr\u21E0\u21E4cy;\u444A\u0180;cw\u08F4\u21EB\u21EFir;\u6948;\u61ADar;\u610Firc;\u4125\u0180alr\u2201\u220E\u2213rts\u0100;u\u2209\u220A\u6665it\xBB\u220Alip;\u6026con;\u62B9r;\uC000\u{1D525}s\u0100ew\u2223\u2229arow;\u6925arow;\u6926\u0280amopr\u223A\u223E\u2243\u225E\u2263rr;\u61FFtht;\u623Bk\u0100lr\u2249\u2253eftarrow;\u61A9ightarrow;\u61AAf;\uC000\u{1D559}bar;\u6015\u0180clt\u226F\u2274\u2278r;\uC000\u{1D4BD}as\xE8\u21F4rok;\u4127\u0100bp\u2282\u2287ull;\u6043hen\xBB\u1C5B\u0AE1\u22A3\\0\u22AA\\0\u22B8\u22C5\u22CE\\0\u22D5\u22F3\\0\\0\u22F8\u2322\u2367\u2362\u237F\\0\u2386\u23AA\u23B4cute\u803B\xED\u40ED\u0180;iy\u0771\u22B0\u22B5rc\u803B\xEE\u40EE;\u4438\u0100cx\u22BC\u22BFy;\u4435cl\u803B\xA1\u40A1\u0100fr\u039F\u22C9;\uC000\u{1D526}rave\u803B\xEC\u40EC\u0200;ino\u073E\u22DD\u22E9\u22EE\u0100in\u22E2\u22E6nt;\u6A0Ct;\u622Dfin;\u69DCta;\u6129lig;\u4133\u0180aop\u22FE\u231A\u231D\u0180cgt\u2305\u2308\u2317r;\u412B\u0180elp\u071F\u230F\u2313in\xE5\u078Ear\xF4\u0720h;\u4131f;\u62B7ed;\u41B5\u0280;cfot\u04F4\u232C\u2331\u233D\u2341are;\u6105in\u0100;t\u2338\u2339\u621Eie;\u69DDdo\xF4\u2319\u0280;celp\u0757\u234C\u2350\u235B\u2361al;\u62BA\u0100gr\u2355\u2359er\xF3\u1563\xE3\u234Darhk;\u6A17rod;\u6A3C\u0200cgpt\u236F\u2372\u2376\u237By;\u4451on;\u412Ff;\uC000\u{1D55A}a;\u43B9uest\u803B\xBF\u40BF\u0100ci\u238A\u238Fr;\uC000\u{1D4BE}n\u0280;Edsv\u04F4\u239B\u239D\u23A1\u04F3;\u62F9ot;\u62F5\u0100;v\u23A6\u23A7\u62F4;\u62F3\u0100;i\u0777\u23AElde;\u4129\u01EB\u23B8\\0\u23BCcy;\u4456l\u803B\xEF\u40EF\u0300cfmosu\u23CC\u23D7\u23DC\u23E1\u23E7\u23F5\u0100iy\u23D1\u23D5rc;\u4135;\u4439r;\uC000\u{1D527}ath;\u4237pf;\uC000\u{1D55B}\u01E3\u23EC\\0\u23F1r;\uC000\u{1D4BF}rcy;\u4458kcy;\u4454\u0400acfghjos\u240B\u2416\u2422\u2427\u242D\u2431\u2435\u243Bppa\u0100;v\u2413\u2414\u43BA;\u43F0\u0100ey\u241B\u2420dil;\u4137;\u443Ar;\uC000\u{1D528}reen;\u4138cy;\u4445cy;\u445Cpf;\uC000\u{1D55C}cr;\uC000\u{1D4C0}\u0B80ABEHabcdefghjlmnoprstuv\u2470\u2481\u2486\u248D\u2491\u250E\u253D\u255A\u2580\u264E\u265E\u2665\u2679\u267D\u269A\u26B2\u26D8\u275D\u2768\u278B\u27C0\u2801\u2812\u0180art\u2477\u247A\u247Cr\xF2\u09C6\xF2\u0395ail;\u691Barr;\u690E\u0100;g\u0994\u248B;\u6A8Bar;\u6962\u0963\u24A5\\0\u24AA\\0\u24B1\\0\\0\\0\\0\\0\u24B5\u24BA\\0\u24C6\u24C8\u24CD\\0\u24F9ute;\u413Amptyv;\u69B4ra\xEE\u084Cbda;\u43BBg\u0180;dl\u088E\u24C1\u24C3;\u6991\xE5\u088E;\u6A85uo\u803B\xAB\u40ABr\u0400;bfhlpst\u0899\u24DE\u24E6\u24E9\u24EB\u24EE\u24F1\u24F5\u0100;f\u089D\u24E3s;\u691Fs;\u691D\xEB\u2252p;\u61ABl;\u6939im;\u6973l;\u61A2\u0180;ae\u24FF\u2500\u2504\u6AABil;\u6919\u0100;s\u2509\u250A\u6AAD;\uC000\u2AAD\uFE00\u0180abr\u2515\u2519\u251Drr;\u690Crk;\u6772\u0100ak\u2522\u252Cc\u0100ek\u2528\u252A;\u407B;\u405B\u0100es\u2531\u2533;\u698Bl\u0100du\u2539\u253B;\u698F;\u698D\u0200aeuy\u2546\u254B\u2556\u2558ron;\u413E\u0100di\u2550\u2554il;\u413C\xEC\u08B0\xE2\u2529;\u443B\u0200cqrs\u2563\u2566\u256D\u257Da;\u6936uo\u0100;r\u0E19\u1746\u0100du\u2572\u2577har;\u6967shar;\u694Bh;\u61B2\u0280;fgqs\u258B\u258C\u0989\u25F3\u25FF\u6264t\u0280ahlrt\u2598\u25A4\u25B7\u25C2\u25E8rrow\u0100;t\u0899\u25A1a\xE9\u24F6arpoon\u0100du\u25AF\u25B4own\xBB\u045Ap\xBB\u0966eftarrows;\u61C7ight\u0180ahs\u25CD\u25D6\u25DErrow\u0100;s\u08F4\u08A7arpoon\xF3\u0F98quigarro\xF7\u21F0hreetimes;\u62CB\u0180;qs\u258B\u0993\u25FAlan\xF4\u09AC\u0280;cdgs\u09AC\u260A\u260D\u261D\u2628c;\u6AA8ot\u0100;o\u2614\u2615\u6A7F\u0100;r\u261A\u261B\u6A81;\u6A83\u0100;e\u2622\u2625\uC000\u22DA\uFE00s;\u6A93\u0280adegs\u2633\u2639\u263D\u2649\u264Bppro\xF8\u24C6ot;\u62D6q\u0100gq\u2643\u2645\xF4\u0989gt\xF2\u248C\xF4\u099Bi\xED\u09B2\u0180ilr\u2655\u08E1\u265Asht;\u697C;\uC000\u{1D529}\u0100;E\u099C\u2663;\u6A91\u0161\u2669\u2676r\u0100du\u25B2\u266E\u0100;l\u0965\u2673;\u696Alk;\u6584cy;\u4459\u0280;acht\u0A48\u2688\u268B\u2691\u2696r\xF2\u25C1orne\xF2\u1D08ard;\u696Bri;\u65FA\u0100io\u269F\u26A4dot;\u4140ust\u0100;a\u26AC\u26AD\u63B0che\xBB\u26AD\u0200Eaes\u26BB\u26BD\u26C9\u26D4;\u6268p\u0100;p\u26C3\u26C4\u6A89rox\xBB\u26C4\u0100;q\u26CE\u26CF\u6A87\u0100;q\u26CE\u26BBim;\u62E6\u0400abnoptwz\u26E9\u26F4\u26F7\u271A\u272F\u2741\u2747\u2750\u0100nr\u26EE\u26F1g;\u67ECr;\u61FDr\xEB\u08C1g\u0180lmr\u26FF\u270D\u2714eft\u0100ar\u09E6\u2707ight\xE1\u09F2apsto;\u67FCight\xE1\u09FDparrow\u0100lr\u2725\u2729ef\xF4\u24EDight;\u61AC\u0180afl\u2736\u2739\u273Dr;\u6985;\uC000\u{1D55D}us;\u6A2Dimes;\u6A34\u0161\u274B\u274Fst;\u6217\xE1\u134E\u0180;ef\u2757\u2758\u1800\u65CAnge\xBB\u2758ar\u0100;l\u2764\u2765\u4028t;\u6993\u0280achmt\u2773\u2776\u277C\u2785\u2787r\xF2\u08A8orne\xF2\u1D8Car\u0100;d\u0F98\u2783;\u696D;\u600Eri;\u62BF\u0300achiqt\u2798\u279D\u0A40\u27A2\u27AE\u27BBquo;\u6039r;\uC000\u{1D4C1}m\u0180;eg\u09B2\u27AA\u27AC;\u6A8D;\u6A8F\u0100bu\u252A\u27B3o\u0100;r\u0E1F\u27B9;\u601Arok;\u4142\u8400<;cdhilqr\u082B\u27D2\u2639\u27DC\u27E0\u27E5\u27EA\u27F0\u0100ci\u27D7\u27D9;\u6AA6r;\u6A79re\xE5\u25F2mes;\u62C9arr;\u6976uest;\u6A7B\u0100Pi\u27F5\u27F9ar;\u6996\u0180;ef\u2800\u092D\u181B\u65C3r\u0100du\u2807\u280Dshar;\u694Ahar;\u6966\u0100en\u2817\u2821rtneqq;\uC000\u2268\uFE00\xC5\u281E\u0700Dacdefhilnopsu\u2840\u2845\u2882\u288E\u2893\u28A0\u28A5\u28A8\u28DA\u28E2\u28E4\u0A83\u28F3\u2902Dot;\u623A\u0200clpr\u284E\u2852\u2863\u287Dr\u803B\xAF\u40AF\u0100et\u2857\u2859;\u6642\u0100;e\u285E\u285F\u6720se\xBB\u285F\u0100;s\u103B\u2868to\u0200;dlu\u103B\u2873\u2877\u287Bow\xEE\u048Cef\xF4\u090F\xF0\u13D1ker;\u65AE\u0100oy\u2887\u288Cmma;\u6A29;\u443Cash;\u6014asuredangle\xBB\u1626r;\uC000\u{1D52A}o;\u6127\u0180cdn\u28AF\u28B4\u28C9ro\u803B\xB5\u40B5\u0200;acd\u1464\u28BD\u28C0\u28C4s\xF4\u16A7ir;\u6AF0ot\u80BB\xB7\u01B5us\u0180;bd\u28D2\u1903\u28D3\u6212\u0100;u\u1D3C\u28D8;\u6A2A\u0163\u28DE\u28E1p;\u6ADB\xF2\u2212\xF0\u0A81\u0100dp\u28E9\u28EEels;\u62A7f;\uC000\u{1D55E}\u0100ct\u28F8\u28FDr;\uC000\u{1D4C2}pos\xBB\u159D\u0180;lm\u2909\u290A\u290D\u43BCtimap;\u62B8\u0C00GLRVabcdefghijlmoprstuvw\u2942\u2953\u297E\u2989\u2998\u29DA\u29E9\u2A15\u2A1A\u2A58\u2A5D\u2A83\u2A95\u2AA4\u2AA8\u2B04\u2B07\u2B44\u2B7F\u2BAE\u2C34\u2C67\u2C7C\u2CE9\u0100gt\u2947\u294B;\uC000\u22D9\u0338\u0100;v\u2950\u0BCF\uC000\u226B\u20D2\u0180elt\u295A\u2972\u2976ft\u0100ar\u2961\u2967rrow;\u61CDightarrow;\u61CE;\uC000\u22D8\u0338\u0100;v\u297B\u0C47\uC000\u226A\u20D2ightarrow;\u61CF\u0100Dd\u298E\u2993ash;\u62AFash;\u62AE\u0280bcnpt\u29A3\u29A7\u29AC\u29B1\u29CCla\xBB\u02DEute;\u4144g;\uC000\u2220\u20D2\u0280;Eiop\u0D84\u29BC\u29C0\u29C5\u29C8;\uC000\u2A70\u0338d;\uC000\u224B\u0338s;\u4149ro\xF8\u0D84ur\u0100;a\u29D3\u29D4\u666El\u0100;s\u29D3\u0B38\u01F3\u29DF\\0\u29E3p\u80BB\xA0\u0B37mp\u0100;e\u0BF9\u0C00\u0280aeouy\u29F4\u29FE\u2A03\u2A10\u2A13\u01F0\u29F9\\0\u29FB;\u6A43on;\u4148dil;\u4146ng\u0100;d\u0D7E\u2A0Aot;\uC000\u2A6D\u0338p;\u6A42;\u443Dash;\u6013\u0380;Aadqsx\u0B92\u2A29\u2A2D\u2A3B\u2A41\u2A45\u2A50rr;\u61D7r\u0100hr\u2A33\u2A36k;\u6924\u0100;o\u13F2\u13F0ot;\uC000\u2250\u0338ui\xF6\u0B63\u0100ei\u2A4A\u2A4Ear;\u6928\xED\u0B98ist\u0100;s\u0BA0\u0B9Fr;\uC000\u{1D52B}\u0200Eest\u0BC5\u2A66\u2A79\u2A7C\u0180;qs\u0BBC\u2A6D\u0BE1\u0180;qs\u0BBC\u0BC5\u2A74lan\xF4\u0BE2i\xED\u0BEA\u0100;r\u0BB6\u2A81\xBB\u0BB7\u0180Aap\u2A8A\u2A8D\u2A91r\xF2\u2971rr;\u61AEar;\u6AF2\u0180;sv\u0F8D\u2A9C\u0F8C\u0100;d\u2AA1\u2AA2\u62FC;\u62FAcy;\u445A\u0380AEadest\u2AB7\u2ABA\u2ABE\u2AC2\u2AC5\u2AF6\u2AF9r\xF2\u2966;\uC000\u2266\u0338rr;\u619Ar;\u6025\u0200;fqs\u0C3B\u2ACE\u2AE3\u2AEFt\u0100ar\u2AD4\u2AD9rro\xF7\u2AC1ightarro\xF7\u2A90\u0180;qs\u0C3B\u2ABA\u2AEAlan\xF4\u0C55\u0100;s\u0C55\u2AF4\xBB\u0C36i\xED\u0C5D\u0100;r\u0C35\u2AFEi\u0100;e\u0C1A\u0C25i\xE4\u0D90\u0100pt\u2B0C\u2B11f;\uC000\u{1D55F}\u8180\xAC;in\u2B19\u2B1A\u2B36\u40ACn\u0200;Edv\u0B89\u2B24\u2B28\u2B2E;\uC000\u22F9\u0338ot;\uC000\u22F5\u0338\u01E1\u0B89\u2B33\u2B35;\u62F7;\u62F6i\u0100;v\u0CB8\u2B3C\u01E1\u0CB8\u2B41\u2B43;\u62FE;\u62FD\u0180aor\u2B4B\u2B63\u2B69r\u0200;ast\u0B7B\u2B55\u2B5A\u2B5Flle\xEC\u0B7Bl;\uC000\u2AFD\u20E5;\uC000\u2202\u0338lint;\u6A14\u0180;ce\u0C92\u2B70\u2B73u\xE5\u0CA5\u0100;c\u0C98\u2B78\u0100;e\u0C92\u2B7D\xF1\u0C98\u0200Aait\u2B88\u2B8B\u2B9D\u2BA7r\xF2\u2988rr\u0180;cw\u2B94\u2B95\u2B99\u619B;\uC000\u2933\u0338;\uC000\u219D\u0338ghtarrow\xBB\u2B95ri\u0100;e\u0CCB\u0CD6\u0380chimpqu\u2BBD\u2BCD\u2BD9\u2B04\u0B78\u2BE4\u2BEF\u0200;cer\u0D32\u2BC6\u0D37\u2BC9u\xE5\u0D45;\uC000\u{1D4C3}ort\u026D\u2B05\\0\\0\u2BD6ar\xE1\u2B56m\u0100;e\u0D6E\u2BDF\u0100;q\u0D74\u0D73su\u0100bp\u2BEB\u2BED\xE5\u0CF8\xE5\u0D0B\u0180bcp\u2BF6\u2C11\u2C19\u0200;Ees\u2BFF\u2C00\u0D22\u2C04\u6284;\uC000\u2AC5\u0338et\u0100;e\u0D1B\u2C0Bq\u0100;q\u0D23\u2C00c\u0100;e\u0D32\u2C17\xF1\u0D38\u0200;Ees\u2C22\u2C23\u0D5F\u2C27\u6285;\uC000\u2AC6\u0338et\u0100;e\u0D58\u2C2Eq\u0100;q\u0D60\u2C23\u0200gilr\u2C3D\u2C3F\u2C45\u2C47\xEC\u0BD7lde\u803B\xF1\u40F1\xE7\u0C43iangle\u0100lr\u2C52\u2C5Ceft\u0100;e\u0C1A\u2C5A\xF1\u0C26ight\u0100;e\u0CCB\u2C65\xF1\u0CD7\u0100;m\u2C6C\u2C6D\u43BD\u0180;es\u2C74\u2C75\u2C79\u4023ro;\u6116p;\u6007\u0480DHadgilrs\u2C8F\u2C94\u2C99\u2C9E\u2CA3\u2CB0\u2CB6\u2CD3\u2CE3ash;\u62ADarr;\u6904p;\uC000\u224D\u20D2ash;\u62AC\u0100et\u2CA8\u2CAC;\uC000\u2265\u20D2;\uC000>\u20D2nfin;\u69DE\u0180Aet\u2CBD\u2CC1\u2CC5rr;\u6902;\uC000\u2264\u20D2\u0100;r\u2CCA\u2CCD\uC000<\u20D2ie;\uC000\u22B4\u20D2\u0100At\u2CD8\u2CDCrr;\u6903rie;\uC000\u22B5\u20D2im;\uC000\u223C\u20D2\u0180Aan\u2CF0\u2CF4\u2D02rr;\u61D6r\u0100hr\u2CFA\u2CFDk;\u6923\u0100;o\u13E7\u13E5ear;\u6927\u1253\u1A95\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\u2D2D\\0\u2D38\u2D48\u2D60\u2D65\u2D72\u2D84\u1B07\\0\\0\u2D8D\u2DAB\\0\u2DC8\u2DCE\\0\u2DDC\u2E19\u2E2B\u2E3E\u2E43\u0100cs\u2D31\u1A97ute\u803B\xF3\u40F3\u0100iy\u2D3C\u2D45r\u0100;c\u1A9E\u2D42\u803B\xF4\u40F4;\u443E\u0280abios\u1AA0\u2D52\u2D57\u01C8\u2D5Alac;\u4151v;\u6A38old;\u69BClig;\u4153\u0100cr\u2D69\u2D6Dir;\u69BF;\uC000\u{1D52C}\u036F\u2D79\\0\\0\u2D7C\\0\u2D82n;\u42DBave\u803B\xF2\u40F2;\u69C1\u0100bm\u2D88\u0DF4ar;\u69B5\u0200acit\u2D95\u2D98\u2DA5\u2DA8r\xF2\u1A80\u0100ir\u2D9D\u2DA0r;\u69BEoss;\u69BBn\xE5\u0E52;\u69C0\u0180aei\u2DB1\u2DB5\u2DB9cr;\u414Dga;\u43C9\u0180cdn\u2DC0\u2DC5\u01CDron;\u43BF;\u69B6pf;\uC000\u{1D560}\u0180ael\u2DD4\u2DD7\u01D2r;\u69B7rp;\u69B9\u0380;adiosv\u2DEA\u2DEB\u2DEE\u2E08\u2E0D\u2E10\u2E16\u6228r\xF2\u1A86\u0200;efm\u2DF7\u2DF8\u2E02\u2E05\u6A5Dr\u0100;o\u2DFE\u2DFF\u6134f\xBB\u2DFF\u803B\xAA\u40AA\u803B\xBA\u40BAgof;\u62B6r;\u6A56lope;\u6A57;\u6A5B\u0180clo\u2E1F\u2E21\u2E27\xF2\u2E01ash\u803B\xF8\u40F8l;\u6298i\u016C\u2E2F\u2E34de\u803B\xF5\u40F5es\u0100;a\u01DB\u2E3As;\u6A36ml\u803B\xF6\u40F6bar;\u633D\u0AE1\u2E5E\\0\u2E7D\\0\u2E80\u2E9D\\0\u2EA2\u2EB9\\0\\0\u2ECB\u0E9C\\0\u2F13\\0\\0\u2F2B\u2FBC\\0\u2FC8r\u0200;ast\u0403\u2E67\u2E72\u0E85\u8100\xB6;l\u2E6D\u2E6E\u40B6le\xEC\u0403\u0269\u2E78\\0\\0\u2E7Bm;\u6AF3;\u6AFDy;\u443Fr\u0280cimpt\u2E8B\u2E8F\u2E93\u1865\u2E97nt;\u4025od;\u402Eil;\u6030enk;\u6031r;\uC000\u{1D52D}\u0180imo\u2EA8\u2EB0\u2EB4\u0100;v\u2EAD\u2EAE\u43C6;\u43D5ma\xF4\u0A76ne;\u660E\u0180;tv\u2EBF\u2EC0\u2EC8\u43C0chfork\xBB\u1FFD;\u43D6\u0100au\u2ECF\u2EDFn\u0100ck\u2ED5\u2EDDk\u0100;h\u21F4\u2EDB;\u610E\xF6\u21F4s\u0480;abcdemst\u2EF3\u2EF4\u1908\u2EF9\u2EFD\u2F04\u2F06\u2F0A\u2F0E\u402Bcir;\u6A23ir;\u6A22\u0100ou\u1D40\u2F02;\u6A25;\u6A72n\u80BB\xB1\u0E9Dim;\u6A26wo;\u6A27\u0180ipu\u2F19\u2F20\u2F25ntint;\u6A15f;\uC000\u{1D561}nd\u803B\xA3\u40A3\u0500;Eaceinosu\u0EC8\u2F3F\u2F41\u2F44\u2F47\u2F81\u2F89\u2F92\u2F7E\u2FB6;\u6AB3p;\u6AB7u\xE5\u0ED9\u0100;c\u0ECE\u2F4C\u0300;acens\u0EC8\u2F59\u2F5F\u2F66\u2F68\u2F7Eppro\xF8\u2F43urlye\xF1\u0ED9\xF1\u0ECE\u0180aes\u2F6F\u2F76\u2F7Approx;\u6AB9qq;\u6AB5im;\u62E8i\xED\u0EDFme\u0100;s\u2F88\u0EAE\u6032\u0180Eas\u2F78\u2F90\u2F7A\xF0\u2F75\u0180dfp\u0EEC\u2F99\u2FAF\u0180als\u2FA0\u2FA5\u2FAAlar;\u632Eine;\u6312urf;\u6313\u0100;t\u0EFB\u2FB4\xEF\u0EFBrel;\u62B0\u0100ci\u2FC0\u2FC5r;\uC000\u{1D4C5};\u43C8ncsp;\u6008\u0300fiopsu\u2FDA\u22E2\u2FDF\u2FE5\u2FEB\u2FF1r;\uC000\u{1D52E}pf;\uC000\u{1D562}rime;\u6057cr;\uC000\u{1D4C6}\u0180aeo\u2FF8\u3009\u3013t\u0100ei\u2FFE\u3005rnion\xF3\u06B0nt;\u6A16st\u0100;e\u3010\u3011\u403F\xF1\u1F19\xF4\u0F14\u0A80ABHabcdefhilmnoprstux\u3040\u3051\u3055\u3059\u30E0\u310E\u312B\u3147\u3162\u3172\u318E\u3206\u3215\u3224\u3229\u3258\u326E\u3272\u3290\u32B0\u32B7\u0180art\u3047\u304A\u304Cr\xF2\u10B3\xF2\u03DDail;\u691Car\xF2\u1C65ar;\u6964\u0380cdenqrt\u3068\u3075\u3078\u307F\u308F\u3094\u30CC\u0100eu\u306D\u3071;\uC000\u223D\u0331te;\u4155i\xE3\u116Emptyv;\u69B3g\u0200;del\u0FD1\u3089\u308B\u308D;\u6992;\u69A5\xE5\u0FD1uo\u803B\xBB\u40BBr\u0580;abcfhlpstw\u0FDC\u30AC\u30AF\u30B7\u30B9\u30BC\u30BE\u30C0\u30C3\u30C7\u30CAp;\u6975\u0100;f\u0FE0\u30B4s;\u6920;\u6933s;\u691E\xEB\u225D\xF0\u272El;\u6945im;\u6974l;\u61A3;\u619D\u0100ai\u30D1\u30D5il;\u691Ao\u0100;n\u30DB\u30DC\u6236al\xF3\u0F1E\u0180abr\u30E7\u30EA\u30EEr\xF2\u17E5rk;\u6773\u0100ak\u30F3\u30FDc\u0100ek\u30F9\u30FB;\u407D;\u405D\u0100es\u3102\u3104;\u698Cl\u0100du\u310A\u310C;\u698E;\u6990\u0200aeuy\u3117\u311C\u3127\u3129ron;\u4159\u0100di\u3121\u3125il;\u4157\xEC\u0FF2\xE2\u30FA;\u4440\u0200clqs\u3134\u3137\u313D\u3144a;\u6937dhar;\u6969uo\u0100;r\u020E\u020Dh;\u61B3\u0180acg\u314E\u315F\u0F44l\u0200;ips\u0F78\u3158\u315B\u109Cn\xE5\u10BBar\xF4\u0FA9t;\u65AD\u0180ilr\u3169\u1023\u316Esht;\u697D;\uC000\u{1D52F}\u0100ao\u3177\u3186r\u0100du\u317D\u317F\xBB\u047B\u0100;l\u1091\u3184;\u696C\u0100;v\u318B\u318C\u43C1;\u43F1\u0180gns\u3195\u31F9\u31FCht\u0300ahlrst\u31A4\u31B0\u31C2\u31D8\u31E4\u31EErrow\u0100;t\u0FDC\u31ADa\xE9\u30C8arpoon\u0100du\u31BB\u31BFow\xEE\u317Ep\xBB\u1092eft\u0100ah\u31CA\u31D0rrow\xF3\u0FEAarpoon\xF3\u0551ightarrows;\u61C9quigarro\xF7\u30CBhreetimes;\u62CCg;\u42DAingdotse\xF1\u1F32\u0180ahm\u320D\u3210\u3213r\xF2\u0FEAa\xF2\u0551;\u600Foust\u0100;a\u321E\u321F\u63B1che\xBB\u321Fmid;\u6AEE\u0200abpt\u3232\u323D\u3240\u3252\u0100nr\u3237\u323Ag;\u67EDr;\u61FEr\xEB\u1003\u0180afl\u3247\u324A\u324Er;\u6986;\uC000\u{1D563}us;\u6A2Eimes;\u6A35\u0100ap\u325D\u3267r\u0100;g\u3263\u3264\u4029t;\u6994olint;\u6A12ar\xF2\u31E3\u0200achq\u327B\u3280\u10BC\u3285quo;\u603Ar;\uC000\u{1D4C7}\u0100bu\u30FB\u328Ao\u0100;r\u0214\u0213\u0180hir\u3297\u329B\u32A0re\xE5\u31F8mes;\u62CAi\u0200;efl\u32AA\u1059\u1821\u32AB\u65B9tri;\u69CEluhar;\u6968;\u611E\u0D61\u32D5\u32DB\u32DF\u332C\u3338\u3371\\0\u337A\u33A4\\0\\0\u33EC\u33F0\\0\u3428\u3448\u345A\u34AD\u34B1\u34CA\u34F1\\0\u3616\\0\\0\u3633cute;\u415Bqu\xEF\u27BA\u0500;Eaceinpsy\u11ED\u32F3\u32F5\u32FF\u3302\u330B\u330F\u331F\u3326\u3329;\u6AB4\u01F0\u32FA\\0\u32FC;\u6AB8on;\u4161u\xE5\u11FE\u0100;d\u11F3\u3307il;\u415Frc;\u415D\u0180Eas\u3316\u3318\u331B;\u6AB6p;\u6ABAim;\u62E9olint;\u6A13i\xED\u1204;\u4441ot\u0180;be\u3334\u1D47\u3335\u62C5;\u6A66\u0380Aacmstx\u3346\u334A\u3357\u335B\u335E\u3363\u336Drr;\u61D8r\u0100hr\u3350\u3352\xEB\u2228\u0100;o\u0A36\u0A34t\u803B\xA7\u40A7i;\u403Bwar;\u6929m\u0100in\u3369\xF0nu\xF3\xF1t;\u6736r\u0100;o\u3376\u2055\uC000\u{1D530}\u0200acoy\u3382\u3386\u3391\u33A0rp;\u666F\u0100hy\u338B\u338Fcy;\u4449;\u4448rt\u026D\u3399\\0\\0\u339Ci\xE4\u1464ara\xEC\u2E6F\u803B\xAD\u40AD\u0100gm\u33A8\u33B4ma\u0180;fv\u33B1\u33B2\u33B2\u43C3;\u43C2\u0400;deglnpr\u12AB\u33C5\u33C9\u33CE\u33D6\u33DE\u33E1\u33E6ot;\u6A6A\u0100;q\u12B1\u12B0\u0100;E\u33D3\u33D4\u6A9E;\u6AA0\u0100;E\u33DB\u33DC\u6A9D;\u6A9Fe;\u6246lus;\u6A24arr;\u6972ar\xF2\u113D\u0200aeit\u33F8\u3408\u340F\u3417\u0100ls\u33FD\u3404lsetm\xE9\u336Ahp;\u6A33parsl;\u69E4\u0100dl\u1463\u3414e;\u6323\u0100;e\u341C\u341D\u6AAA\u0100;s\u3422\u3423\u6AAC;\uC000\u2AAC\uFE00\u0180flp\u342E\u3433\u3442tcy;\u444C\u0100;b\u3438\u3439\u402F\u0100;a\u343E\u343F\u69C4r;\u633Ff;\uC000\u{1D564}a\u0100dr\u344D\u0402es\u0100;u\u3454\u3455\u6660it\xBB\u3455\u0180csu\u3460\u3479\u349F\u0100au\u3465\u346Fp\u0100;s\u1188\u346B;\uC000\u2293\uFE00p\u0100;s\u11B4\u3475;\uC000\u2294\uFE00u\u0100bp\u347F\u348F\u0180;es\u1197\u119C\u3486et\u0100;e\u1197\u348D\xF1\u119D\u0180;es\u11A8\u11AD\u3496et\u0100;e\u11A8\u349D\xF1\u11AE\u0180;af\u117B\u34A6\u05B0r\u0165\u34AB\u05B1\xBB\u117Car\xF2\u1148\u0200cemt\u34B9\u34BE\u34C2\u34C5r;\uC000\u{1D4C8}tm\xEE\xF1i\xEC\u3415ar\xE6\u11BE\u0100ar\u34CE\u34D5r\u0100;f\u34D4\u17BF\u6606\u0100an\u34DA\u34EDight\u0100ep\u34E3\u34EApsilo\xEE\u1EE0h\xE9\u2EAFs\xBB\u2852\u0280bcmnp\u34FB\u355E\u1209\u358B\u358E\u0480;Edemnprs\u350E\u350F\u3511\u3515\u351E\u3523\u352C\u3531\u3536\u6282;\u6AC5ot;\u6ABD\u0100;d\u11DA\u351Aot;\u6AC3ult;\u6AC1\u0100Ee\u3528\u352A;\u6ACB;\u628Alus;\u6ABFarr;\u6979\u0180eiu\u353D\u3552\u3555t\u0180;en\u350E\u3545\u354Bq\u0100;q\u11DA\u350Feq\u0100;q\u352B\u3528m;\u6AC7\u0100bp\u355A\u355C;\u6AD5;\u6AD3c\u0300;acens\u11ED\u356C\u3572\u3579\u357B\u3326ppro\xF8\u32FAurlye\xF1\u11FE\xF1\u11F3\u0180aes\u3582\u3588\u331Bppro\xF8\u331Aq\xF1\u3317g;\u666A\u0680123;Edehlmnps\u35A9\u35AC\u35AF\u121C\u35B2\u35B4\u35C0\u35C9\u35D5\u35DA\u35DF\u35E8\u35ED\u803B\xB9\u40B9\u803B\xB2\u40B2\u803B\xB3\u40B3;\u6AC6\u0100os\u35B9\u35BCt;\u6ABEub;\u6AD8\u0100;d\u1222\u35C5ot;\u6AC4s\u0100ou\u35CF\u35D2l;\u67C9b;\u6AD7arr;\u697Bult;\u6AC2\u0100Ee\u35E4\u35E6;\u6ACC;\u628Blus;\u6AC0\u0180eiu\u35F4\u3609\u360Ct\u0180;en\u121C\u35FC\u3602q\u0100;q\u1222\u35B2eq\u0100;q\u35E7\u35E4m;\u6AC8\u0100bp\u3611\u3613;\u6AD4;\u6AD6\u0180Aan\u361C\u3620\u362Drr;\u61D9r\u0100hr\u3626\u3628\xEB\u222E\u0100;o\u0A2B\u0A29war;\u692Alig\u803B\xDF\u40DF\u0BE1\u3651\u365D\u3660\u12CE\u3673\u3679\\0\u367E\u36C2\\0\\0\\0\\0\\0\u36DB\u3703\\0\u3709\u376C\\0\\0\\0\u3787\u0272\u3656\\0\\0\u365Bget;\u6316;\u43C4r\xEB\u0E5F\u0180aey\u3666\u366B\u3670ron;\u4165dil;\u4163;\u4442lrec;\u6315r;\uC000\u{1D531}\u0200eiko\u3686\u369D\u36B5\u36BC\u01F2\u368B\\0\u3691e\u01004f\u1284\u1281a\u0180;sv\u3698\u3699\u369B\u43B8ym;\u43D1\u0100cn\u36A2\u36B2k\u0100as\u36A8\u36AEppro\xF8\u12C1im\xBB\u12ACs\xF0\u129E\u0100as\u36BA\u36AE\xF0\u12C1rn\u803B\xFE\u40FE\u01EC\u031F\u36C6\u22E7es\u8180\xD7;bd\u36CF\u36D0\u36D8\u40D7\u0100;a\u190F\u36D5r;\u6A31;\u6A30\u0180eps\u36E1\u36E3\u3700\xE1\u2A4D\u0200;bcf\u0486\u36EC\u36F0\u36F4ot;\u6336ir;\u6AF1\u0100;o\u36F9\u36FC\uC000\u{1D565}rk;\u6ADA\xE1\u3362rime;\u6034\u0180aip\u370F\u3712\u3764d\xE5\u1248\u0380adempst\u3721\u374D\u3740\u3751\u3757\u375C\u375Fngle\u0280;dlqr\u3730\u3731\u3736\u3740\u3742\u65B5own\xBB\u1DBBeft\u0100;e\u2800\u373E\xF1\u092E;\u625Cight\u0100;e\u32AA\u374B\xF1\u105Aot;\u65ECinus;\u6A3Alus;\u6A39b;\u69CDime;\u6A3Bezium;\u63E2\u0180cht\u3772\u377D\u3781\u0100ry\u3777\u377B;\uC000\u{1D4C9};\u4446cy;\u445Brok;\u4167\u0100io\u378B\u378Ex\xF4\u1777head\u0100lr\u3797\u37A0eftarro\xF7\u084Fightarrow\xBB\u0F5D\u0900AHabcdfghlmoprstuw\u37D0\u37D3\u37D7\u37E4\u37F0\u37FC\u380E\u381C\u3823\u3834\u3851\u385D\u386B\u38A9\u38CC\u38D2\u38EA\u38F6r\xF2\u03EDar;\u6963\u0100cr\u37DC\u37E2ute\u803B\xFA\u40FA\xF2\u1150r\u01E3\u37EA\\0\u37EDy;\u445Eve;\u416D\u0100iy\u37F5\u37FArc\u803B\xFB\u40FB;\u4443\u0180abh\u3803\u3806\u380Br\xF2\u13ADlac;\u4171a\xF2\u13C3\u0100ir\u3813\u3818sht;\u697E;\uC000\u{1D532}rave\u803B\xF9\u40F9\u0161\u3827\u3831r\u0100lr\u382C\u382E\xBB\u0957\xBB\u1083lk;\u6580\u0100ct\u3839\u384D\u026F\u383F\\0\\0\u384Arn\u0100;e\u3845\u3846\u631Cr\xBB\u3846op;\u630Fri;\u65F8\u0100al\u3856\u385Acr;\u416B\u80BB\xA8\u0349\u0100gp\u3862\u3866on;\u4173f;\uC000\u{1D566}\u0300adhlsu\u114B\u3878\u387D\u1372\u3891\u38A0own\xE1\u13B3arpoon\u0100lr\u3888\u388Cef\xF4\u382Digh\xF4\u382Fi\u0180;hl\u3899\u389A\u389C\u43C5\xBB\u13FAon\xBB\u389Aparrows;\u61C8\u0180cit\u38B0\u38C4\u38C8\u026F\u38B6\\0\\0\u38C1rn\u0100;e\u38BC\u38BD\u631Dr\xBB\u38BDop;\u630Eng;\u416Fri;\u65F9cr;\uC000\u{1D4CA}\u0180dir\u38D9\u38DD\u38E2ot;\u62F0lde;\u4169i\u0100;f\u3730\u38E8\xBB\u1813\u0100am\u38EF\u38F2r\xF2\u38A8l\u803B\xFC\u40FCangle;\u69A7\u0780ABDacdeflnoprsz\u391C\u391F\u3929\u392D\u39B5\u39B8\u39BD\u39DF\u39E4\u39E8\u39F3\u39F9\u39FD\u3A01\u3A20r\xF2\u03F7ar\u0100;v\u3926\u3927\u6AE8;\u6AE9as\xE8\u03E1\u0100nr\u3932\u3937grt;\u699C\u0380eknprst\u34E3\u3946\u394B\u3952\u395D\u3964\u3996app\xE1\u2415othin\xE7\u1E96\u0180hir\u34EB\u2EC8\u3959op\xF4\u2FB5\u0100;h\u13B7\u3962\xEF\u318D\u0100iu\u3969\u396Dgm\xE1\u33B3\u0100bp\u3972\u3984setneq\u0100;q\u397D\u3980\uC000\u228A\uFE00;\uC000\u2ACB\uFE00setneq\u0100;q\u398F\u3992\uC000\u228B\uFE00;\uC000\u2ACC\uFE00\u0100hr\u399B\u399Fet\xE1\u369Ciangle\u0100lr\u39AA\u39AFeft\xBB\u0925ight\xBB\u1051y;\u4432ash\xBB\u1036\u0180elr\u39C4\u39D2\u39D7\u0180;be\u2DEA\u39CB\u39CFar;\u62BBq;\u625Alip;\u62EE\u0100bt\u39DC\u1468a\xF2\u1469r;\uC000\u{1D533}tr\xE9\u39AEsu\u0100bp\u39EF\u39F1\xBB\u0D1C\xBB\u0D59pf;\uC000\u{1D567}ro\xF0\u0EFBtr\xE9\u39B4\u0100cu\u3A06\u3A0Br;\uC000\u{1D4CB}\u0100bp\u3A10\u3A18n\u0100Ee\u3980\u3A16\xBB\u397En\u0100Ee\u3992\u3A1E\xBB\u3990igzag;\u699A\u0380cefoprs\u3A36\u3A3B\u3A56\u3A5B\u3A54\u3A61\u3A6Airc;\u4175\u0100di\u3A40\u3A51\u0100bg\u3A45\u3A49ar;\u6A5Fe\u0100;q\u15FA\u3A4F;\u6259erp;\u6118r;\uC000\u{1D534}pf;\uC000\u{1D568}\u0100;e\u1479\u3A66at\xE8\u1479cr;\uC000\u{1D4CC}\u0AE3\u178E\u3A87\\0\u3A8B\\0\u3A90\u3A9B\\0\\0\u3A9D\u3AA8\u3AAB\u3AAF\\0\\0\u3AC3\u3ACE\\0\u3AD8\u17DC\u17DFtr\xE9\u17D1r;\uC000\u{1D535}\u0100Aa\u3A94\u3A97r\xF2\u03C3r\xF2\u09F6;\u43BE\u0100Aa\u3AA1\u3AA4r\xF2\u03B8r\xF2\u09EBa\xF0\u2713is;\u62FB\u0180dpt\u17A4\u3AB5\u3ABE\u0100fl\u3ABA\u17A9;\uC000\u{1D569}im\xE5\u17B2\u0100Aa\u3AC7\u3ACAr\xF2\u03CEr\xF2\u0A01\u0100cq\u3AD2\u17B8r;\uC000\u{1D4CD}\u0100pt\u17D6\u3ADCr\xE9\u17D4\u0400acefiosu\u3AF0\u3AFD\u3B08\u3B0C\u3B11\u3B15\u3B1B\u3B21c\u0100uy\u3AF6\u3AFBte\u803B\xFD\u40FD;\u444F\u0100iy\u3B02\u3B06rc;\u4177;\u444Bn\u803B\xA5\u40A5r;\uC000\u{1D536}cy;\u4457pf;\uC000\u{1D56A}cr;\uC000\u{1D4CE}\u0100cm\u3B26\u3B29y;\u444El\u803B\xFF\u40FF\u0500acdefhiosw\u3B42\u3B48\u3B54\u3B58\u3B64\u3B69\u3B6D\u3B74\u3B7A\u3B80cute;\u417A\u0100ay\u3B4D\u3B52ron;\u417E;\u4437ot;\u417C\u0100et\u3B5D\u3B61tr\xE6\u155Fa;\u43B6r;\uC000\u{1D537}cy;\u4436grarr;\u61DDpf;\uC000\u{1D56B}cr;\uC000\u{1D4CF}\u0100jn\u3B85\u3B87;\u600Dj;\u600C\'.split("").map(e=>e.charCodeAt(0))),xn=new Uint16Array("\u0200aglq \\x1B\u026D\\0\\0p;\u4026os;\u4027t;\u403Et;\u403Cuot;\u4022".split("").map(e=>e.charCodeAt(0)));var Xe;const gn=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]),mn=(Xe=String.fromCodePoint)!==null&&Xe!==void 0?Xe:function(e){let u="";return e>65535&&(e-=65536,u+=String.fromCharCode(e>>>10&1023|55296),e=56320|e&1023),u+=String.fromCharCode(e),u};function yn(e){var u;return e>=55296&&e<=57343||e>1114111?65533:(u=gn.get(e))!==null&&u!==void 0?u:e}var B;(function(e){e[e.NUM=35]="NUM",e[e.SEMI=59]="SEMI",e[e.EQUALS=61]="EQUALS",e[e.ZERO=48]="ZERO",e[e.NINE=57]="NINE",e[e.LOWER_A=97]="LOWER_A",e[e.LOWER_F=102]="LOWER_F",e[e.LOWER_X=120]="LOWER_X",e[e.LOWER_Z=122]="LOWER_Z",e[e.UPPER_A=65]="UPPER_A",e[e.UPPER_F=70]="UPPER_F",e[e.UPPER_Z=90]="UPPER_Z"})(B||(B={}));const kn=32;var R;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(R||(R={}));function Je(e){return e>=B.ZERO&&e<=B.NINE}function vn(e){return e>=B.UPPER_A&&e<=B.UPPER_F||e>=B.LOWER_A&&e<=B.LOWER_F}function wn(e){return e>=B.UPPER_A&&e<=B.UPPER_Z||e>=B.LOWER_A&&e<=B.LOWER_Z||Je(e)}function _n(e){return e===B.EQUALS||wn(e)}var $;(function(e){e[e.EntityStart=0]="EntityStart",e[e.NumericStart=1]="NumericStart",e[e.NumericDecimal=2]="NumericDecimal",e[e.NumericHex=3]="NumericHex",e[e.NamedEntity=4]="NamedEntity"})($||($={}));var Y;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(Y||(Y={}));class Cn{constructor(u,t,r){this.decodeTree=u,this.emitCodePoint=t,this.errors=r,this.state=$.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=Y.Strict}startEntity(u){this.decodeMode=u,this.state=$.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(u,t){switch(this.state){case $.EntityStart:return u.charCodeAt(t)===B.NUM?(this.state=$.NumericStart,this.consumed+=1,this.stateNumericStart(u,t+1)):(this.state=$.NamedEntity,this.stateNamedEntity(u,t));case $.NumericStart:return this.stateNumericStart(u,t);case $.NumericDecimal:return this.stateNumericDecimal(u,t);case $.NumericHex:return this.stateNumericHex(u,t);case $.NamedEntity:return this.stateNamedEntity(u,t)}}stateNumericStart(u,t){return t>=u.length?-1:(u.charCodeAt(t)|kn)===B.LOWER_X?(this.state=$.NumericHex,this.consumed+=1,this.stateNumericHex(u,t+1)):(this.state=$.NumericDecimal,this.stateNumericDecimal(u,t))}addToNumericResult(u,t,r,n){if(t!==r){const o=r-t;this.result=this.result*Math.pow(n,o)+parseInt(u.substr(t,o),n),this.consumed+=o}}stateNumericHex(u,t){const r=t;for(;t<u.length;){const n=u.charCodeAt(t);if(Je(n)||vn(n))t+=1;else return this.addToNumericResult(u,r,t,16),this.emitNumericEntity(n,3)}return this.addToNumericResult(u,r,t,16),-1}stateNumericDecimal(u,t){const r=t;for(;t<u.length;){const n=u.charCodeAt(t);if(Je(n))t+=1;else return this.addToNumericResult(u,r,t,10),this.emitNumericEntity(n,2)}return this.addToNumericResult(u,r,t,10),-1}emitNumericEntity(u,t){var r;if(this.consumed<=t)return(r=this.errors)===null||r===void 0||r.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(u===B.SEMI)this.consumed+=1;else if(this.decodeMode===Y.Strict)return 0;return this.emitCodePoint(yn(this.result),this.consumed),this.errors&&(u!==B.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(u,t){const{decodeTree:r}=this;let n=r[this.treeIndex],o=(n&R.VALUE_LENGTH)>>14;for(;t<u.length;t++,this.excess++){const c=u.charCodeAt(t);if(this.treeIndex=En(r,n,this.treeIndex+Math.max(1,o),c),this.treeIndex<0)return this.result===0||this.decodeMode===Y.Attribute&&(o===0||_n(c))?0:this.emitNotTerminatedNamedEntity();if(n=r[this.treeIndex],o=(n&R.VALUE_LENGTH)>>14,o!==0){if(c===B.SEMI)return this.emitNamedEntityData(this.treeIndex,o,this.consumed+this.excess);this.decodeMode!==Y.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var u;const{result:t,decodeTree:r}=this,n=(r[t]&R.VALUE_LENGTH)>>14;return this.emitNamedEntityData(t,n,this.consumed),(u=this.errors)===null||u===void 0||u.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(u,t,r){const{decodeTree:n}=this;return this.emitCodePoint(t===1?n[u]&~R.VALUE_LENGTH:n[u+1],r),t===3&&this.emitCodePoint(n[u+2],r),r}end(){var u;switch(this.state){case $.NamedEntity:return this.result!==0&&(this.decodeMode!==Y.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case $.NumericDecimal:return this.emitNumericEntity(0,2);case $.NumericHex:return this.emitNumericEntity(0,3);case $.NumericStart:return(u=this.errors)===null||u===void 0||u.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case $.EntityStart:return 0}}}function Ju(e){let u="";const t=new Cn(e,r=>u+=mn(r));return function(n,o){let c=0,s=0;for(;(s=n.indexOf("&",s))>=0;){u+=n.slice(c,s),t.startEntity(o);const i=t.write(n,s+1);if(i<0){c=s+t.end();break}c=s+i,s=i===0?c+1:c}const l=u+n.slice(c);return u="",l}}function En(e,u,t,r){const n=(u&R.BRANCH_LENGTH)>>7,o=u&R.JUMP_TABLE;if(n===0)return o!==0&&r===o?t:-1;if(o){const l=r-o;return l<0||l>=n?-1:e[t+l]-1}let c=t,s=c+n-1;for(;c<=s;){const l=c+s>>>1,i=e[l];if(i<r)c=l+1;else if(i>r)s=l-1;else return e[l+n]}return-1}const Qu=Ju(bn);Ju(xn);function Dn(e,u=Y.Legacy){return Qu(e,u)}function An(e){return Qu(e,Y.Strict)}function Fn(e){return Object.prototype.toString.call(e)}function Qe(e){return Fn(e)==="[object String]"}const Nn=Object.prototype.hasOwnProperty;function Sn(e,u){return Nn.call(e,u)}function Ie(e){return Array.prototype.slice.call(arguments,1).forEach(function(t){if(t){if(typeof t!="object")throw new TypeError(t+"must be object");Object.keys(t).forEach(function(r){e[r]=t[r]})}}),e}function Ku(e,u,t){return[].concat(e.slice(0,u),t,e.slice(u+1))}function Ke(e){return!(e>=55296&&e<=57343||e>=64976&&e<=65007||(e&65535)===65535||(e&65535)===65534||e>=0&&e<=8||e===11||e>=14&&e<=31||e>=127&&e<=159||e>1114111)}function xe(e){if(e>65535){e-=65536;const u=55296+(e>>10),t=56320+(e&1023);return String.fromCharCode(u,t)}return String.fromCharCode(e)}const Yu=/\\\\([!"#$%&\'()*+,\\-./:;<=>?@[\\\\\\]^_`{|}~])/g,Tn=/&([a-z#][a-z0-9]{1,31});/gi,In=new RegExp(Yu.source+"|"+Tn.source,"gi"),Mn=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function Ln(e,u){if(u.charCodeAt(0)===35&&Mn.test(u)){const r=u[1].toLowerCase()==="x"?parseInt(u.slice(2),16):parseInt(u.slice(1),10);return Ke(r)?xe(r):e}const t=Dn(e);return t!==e?t:e}function Pn(e){return e.indexOf("\\\\")<0?e:e.replace(Yu,"$1")}function ce(e){return e.indexOf("\\\\")<0&&e.indexOf("&")<0?e:e.replace(In,function(u,t,r){return t||Ln(u,r)})}const Bn=/[&<>"]/,$n=/[&<>"]/g,On={"&":"&","<":"<",">":">",\'"\':"""};function zn(e){return On[e]}function ee(e){return Bn.test(e)?e.replace($n,zn):e}const jn=/[.?*+^$[\\]\\\\(){}|-]/g;function qn(e){return e.replace(jn,"\\\\$&")}function M(e){switch(e){case 9:case 32:return!0}return!1}function ge(e){if(e>=8192&&e<=8202)return!0;switch(e){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0}return!1}function Ru(e){return Ge.test(e)||Gu.test(e)}function me(e){return Ru(xe(e))}function ye(e){switch(e){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1}}function Me(e){return e=e.trim().replace(/\\s+/g," "),"\u1E9E".toLowerCase()==="\u1E7E"&&(e=e.replace(/\u1E9E/g,"\xDF")),e.toLowerCase().toUpperCase()}function et(e){return e===32||e===9||e===10||e===13}function Le(e){let u=0;for(;u<e.length&&et(e.charCodeAt(u));u++);let t=e.length-1;for(;t>=u&&et(e.charCodeAt(t));t--);return e.slice(u,t+1)}const Hn=Object.freeze(Object.defineProperty({__proto__:null,arrayReplaceAt:Ku,asciiTrim:Le,assign:Ie,escapeHtml:ee,escapeRE:qn,fromCodePoint:xe,has:Sn,isMdAsciiPunct:ye,isPunctChar:Ru,isPunctCharCode:me,isSpace:M,isString:Qe,isValidEntityCode:Ke,isWhiteSpace:ge,lib:{mdurl:fn,ucmicro:hn},normalizeReference:Me,unescapeAll:ce,unescapeMd:Pn},Symbol.toStringTag,{value:"Module"}));function Zn(e,u,t){let r,n,o,c;const s=e.posMax,l=e.pos;for(e.pos=u+1,r=1;e.pos<s;){if(o=e.src.charCodeAt(e.pos),o===93&&(r--,r===0)){n=!0;break}if(c=e.pos,e.md.inline.skipToken(e),o===91){if(c===e.pos-1)r++;else if(t)return e.pos=l,-1}}let i=-1;return n&&(i=e.pos),e.pos=l,i}function Vn(e,u,t){let r,n=u;const o={ok:!1,pos:0,str:""};if(e.charCodeAt(n)===60){for(n++;n<t;){if(r=e.charCodeAt(n),r===10||r===60)return o;if(r===62)return o.pos=n+1,o.str=ce(e.slice(u+1,n)),o.ok=!0,o;if(r===92&&n+1<t){n+=2;continue}n++}return o}let c=0;for(;n<t&&(r=e.charCodeAt(n),!(r===32||r<32||r===127));){if(r===92&&n+1<t){if(e.charCodeAt(n+1)===32)break;n+=2;continue}if(r===40&&(c++,c>32))return o;if(r===41){if(c===0)break;c--}n++}return u===n||c!==0||(o.str=ce(e.slice(u,n)),o.pos=n,o.ok=!0),o}function Un(e,u,t,r){let n,o=u;const c={ok:!1,can_continue:!1,pos:0,str:"",marker:0};if(r)c.str=r.str,c.marker=r.marker;else{if(o>=t)return c;let s=e.charCodeAt(o);if(s!==34&&s!==39&&s!==40)return c;u++,o++,s===40&&(s=41),c.marker=s}for(;o<t;){if(n=e.charCodeAt(o),n===c.marker)return c.pos=o+1,c.str+=ce(e.slice(u,o)),c.ok=!0,c;if(n===40&&c.marker===41)return c;n===92&&o+1<t&&o++,o++}return c.can_continue=!0,c.str+=ce(e.slice(u,o)),c}const Wn=Object.freeze(Object.defineProperty({__proto__:null,parseLinkDestination:Vn,parseLinkLabel:Zn,parseLinkTitle:Un},Symbol.toStringTag,{value:"Module"})),X={};X.code_inline=function(e,u,t,r,n){const o=e[u];return"<code"+n.renderAttrs(o)+">"+ee(o.content)+"</code>"},X.code_block=function(e,u,t,r,n){const o=e[u];return"<pre"+n.renderAttrs(o)+"><code>"+ee(e[u].content)+`</code></pre>\n`},X.fence=function(e,u,t,r,n){const o=e[u],c=o.info?ce(o.info).trim():"";let s="",l="";if(c){const d=c.split(/(\\s+)/g);s=d[0],l=d.slice(2).join("")}let i;if(t.highlight?i=t.highlight(o.content,s,l)||ee(o.content):i=ee(o.content),i.indexOf("<pre")===0)return i+`\n`;if(c){const d=o.attrIndex("class"),f=o.attrs?o.attrs.slice():[];d<0?f.push(["class",t.langPrefix+s]):(f[d]=f[d].slice(),f[d][1]+=" "+t.langPrefix+s);const b={attrs:f};return`<pre><code${n.renderAttrs(b)}>${i}</code></pre>\n`}return`<pre><code${n.renderAttrs(o)}>${i}</code></pre>\n`},X.image=function(e,u,t,r,n){const o=e[u];return o.attrs[o.attrIndex("alt")][1]=n.renderInlineAsText(o.children,t,r),n.renderToken(e,u,t)},X.hardbreak=function(e,u,t){return t.xhtmlOut?`<br />\n`:`<br>\n`},X.softbreak=function(e,u,t){return t.breaks?t.xhtmlOut?`<br />\n`:`<br>\n`:`\n`},X.text=function(e,u){return ee(e[u].content)},X.html_block=function(e,u){return e[u].content},X.html_inline=function(e,u){return e[u].content};function se(){this.rules=Ie({},X)}se.prototype.renderAttrs=function(u){let t,r,n;if(!u.attrs)return"";for(n="",t=0,r=u.attrs.length;t<r;t++)n+=" "+ee(u.attrs[t][0])+\'="\'+ee(u.attrs[t][1])+\'"\';return n},se.prototype.renderToken=function(u,t,r){const n=u[t];let o="";if(n.hidden)return"";n.block&&n.nesting!==-1&&t&&u[t-1].hidden&&(o+=`\n`),o+=(n.nesting===-1?"</":"<")+n.tag,o+=this.renderAttrs(n),n.nesting===0&&r.xhtmlOut&&(o+=" /");let c=!1;if(n.block&&(c=!0,n.nesting===1&&t+1<u.length)){const s=u[t+1];(s.type==="inline"||s.hidden||s.nesting===-1&&s.tag===n.tag)&&(c=!1)}return o+=c?`>\n`:">",o},se.prototype.renderInline=function(e,u,t){let r="";const n=this.rules;for(let o=0,c=e.length;o<c;o++){const s=e[o].type;typeof n[s]<"u"?r+=n[s](e,o,u,t,this):r+=this.renderToken(e,o,u)}return r},se.prototype.renderInlineAsText=function(e,u,t){let r="";for(let n=0,o=e.length;n<o;n++)switch(e[n].type){case"text":r+=e[n].content;break;case"image":r+=this.renderInlineAsText(e[n].children,u,t);break;case"html_inline":case"html_block":r+=e[n].content;break;case"softbreak":case"hardbreak":r+=`\n`;break}return r},se.prototype.render=function(e,u,t){let r="";const n=this.rules;for(let o=0,c=e.length;o<c;o++){const s=e[o].type;s==="inline"?r+=this.renderInline(e[o].children,u,t):typeof n[s]<"u"?r+=n[s](e,o,u,t,this):r+=this.renderToken(e,o,u,t)}return r};function q(){this.__rules__=[],this.__cache__=null}q.prototype.__find__=function(e){for(let u=0;u<this.__rules__.length;u++)if(this.__rules__[u].name===e)return u;return-1},q.prototype.__compile__=function(){const e=this,u=[""];e.__rules__.forEach(function(t){t.enabled&&t.alt.forEach(function(r){u.indexOf(r)<0&&u.push(r)})}),e.__cache__={},u.forEach(function(t){e.__cache__[t]=[],e.__rules__.forEach(function(r){r.enabled&&(t&&r.alt.indexOf(t)<0||e.__cache__[t].push(r.fn))})})},q.prototype.at=function(e,u,t){const r=this.__find__(e),n=t||{};if(r===-1)throw new Error("Parser rule not found: "+e);this.__rules__[r].fn=u,this.__rules__[r].alt=n.alt||[],this.__cache__=null},q.prototype.before=function(e,u,t,r){const n=this.__find__(e),o=r||{};if(n===-1)throw new Error("Parser rule not found: "+e);this.__rules__.splice(n,0,{name:u,enabled:!0,fn:t,alt:o.alt||[]}),this.__cache__=null},q.prototype.after=function(e,u,t,r){const n=this.__find__(e),o=r||{};if(n===-1)throw new Error("Parser rule not found: "+e);this.__rules__.splice(n+1,0,{name:u,enabled:!0,fn:t,alt:o.alt||[]}),this.__cache__=null},q.prototype.push=function(e,u,t){const r=t||{};this.__rules__.push({name:e,enabled:!0,fn:u,alt:r.alt||[]}),this.__cache__=null},q.prototype.enable=function(e,u){Array.isArray(e)||(e=[e]);const t=[];return e.forEach(function(r){const n=this.__find__(r);if(n<0){if(u)return;throw new Error("Rules manager: invalid rule name "+r)}this.__rules__[n].enabled=!0,t.push(r)},this),this.__cache__=null,t},q.prototype.enableOnly=function(e,u){Array.isArray(e)||(e=[e]),this.__rules__.forEach(function(t){t.enabled=!1}),this.enable(e,u)},q.prototype.disable=function(e,u){Array.isArray(e)||(e=[e]);const t=[];return e.forEach(function(r){const n=this.__find__(r);if(n<0){if(u)return;throw new Error("Rules manager: invalid rule name "+r)}this.__rules__[n].enabled=!1,t.push(r)},this),this.__cache__=null,t},q.prototype.getRules=function(e){return this.__cache__===null&&this.__compile__(),this.__cache__[e]||[]};function U(e,u,t){this.type=e,this.tag=u,this.attrs=null,this.map=null,this.nesting=t,this.level=0,this.children=null,this.content="",this.markup="",this.info="",this.meta=null,this.block=!1,this.hidden=!1}U.prototype.attrIndex=function(u){if(!this.attrs)return-1;const t=this.attrs;for(let r=0,n=t.length;r<n;r++)if(t[r][0]===u)return r;return-1},U.prototype.attrPush=function(u){this.attrs?this.attrs.push(u):this.attrs=[u]},U.prototype.attrSet=function(u,t){const r=this.attrIndex(u),n=[u,t];r<0?this.attrPush(n):this.attrs[r]=n},U.prototype.attrGet=function(u){const t=this.attrIndex(u);let r=null;return t>=0&&(r=this.attrs[t][1]),r},U.prototype.attrJoin=function(u,t){const r=this.attrIndex(u);r<0?this.attrPush([u,t]):this.attrs[r][1]=this.attrs[r][1]+" "+t};function ut(e,u,t){this.src=e,this.env=t,this.tokens=[],this.inlineMode=!1,this.md=u}ut.prototype.Token=U;const Gn=/\\r\\n?|\\n/g,Xn=/\\0/g;function Jn(e){let u;u=e.src.replace(Gn,`\n`),u=u.replace(Xn,"\uFFFD"),e.src=u}function Qn(e){let u;e.inlineMode?(u=new e.Token("inline","",0),u.content=e.src,u.map=[0,1],u.children=[],e.tokens.push(u)):e.md.block.parse(e.src,e.md,e.env,e.tokens)}function Kn(e){const u=e.tokens;for(let t=0,r=u.length;t<r;t++){const n=u[t];n.type==="inline"&&e.md.inline.parse(n.content,e.md,e.env,n.children)}}function Yn(e){return/^<a[>\\s]/i.test(e)}function Rn(e){return/^<\\/a\\s*>/i.test(e)}function e0(e){const u=e.tokens;if(e.md.options.linkify)for(let t=0,r=u.length;t<r;t++){if(u[t].type!=="inline"||!e.md.linkify.pretest(u[t].content))continue;let n=u[t].children,o=0;for(let c=n.length-1;c>=0;c--){const s=n[c];if(s.type==="link_close"){for(c--;n[c].level!==s.level&&n[c].type!=="link_open";)c--;continue}if(s.type==="html_inline"&&(Yn(s.content)&&o>0&&o--,Rn(s.content)&&o++),!(o>0)&&s.type==="text"&&e.md.linkify.test(s.content)){const l=s.content;let i=e.md.linkify.match(l);const d=[];let f=s.level,b=0;i.length>0&&i[0].index===0&&c>0&&n[c-1].type==="text_special"&&(i=i.slice(1));for(let h=0;h<i.length;h++){const p=i[h].url,k=e.md.normalizeLink(p);if(!e.md.validateLink(k))continue;let y=i[h].text;i[h].schema?i[h].schema==="mailto:"&&!/^mailto:/i.test(y)?y=e.md.normalizeLinkText("mailto:"+y).replace(/^mailto:/,""):y=e.md.normalizeLinkText(y):y=e.md.normalizeLinkText("http://"+y).replace(/^http:\\/\\//,"");const D=i[h].index;if(D>b){const v=new e.Token("text","",0);v.content=l.slice(b,D),v.level=f,d.push(v)}const x=new e.Token("link_open","a",1);x.attrs=[["href",k]],x.level=f++,x.markup="linkify",x.info="auto",d.push(x);const m=new e.Token("text","",0);m.content=y,m.level=f,d.push(m);const _=new e.Token("link_close","a",-1);_.level=--f,_.markup="linkify",_.info="auto",d.push(_),b=i[h].lastIndex}if(b<l.length){const h=new e.Token("text","",0);h.content=l.slice(b),h.level=f,d.push(h)}u[t].children=n=Ku(n,c,d)}}}}const tt=/\\+-|\\.\\.|\\?\\?\\?\\?|!!!!|,,|--/,u0=/\\((c|tm|r)\\)/i,t0=/\\((c|tm|r)\\)/ig,r0={c:"\xA9",r:"\xAE",tm:"\u2122"};function n0(e,u){return r0[u.toLowerCase()]}function o0(e){let u=0;for(let t=e.length-1;t>=0;t--){const r=e[t];r.type==="text"&&!u&&(r.content=r.content.replace(t0,n0)),r.type==="link_open"&&r.info==="auto"&&u--,r.type==="link_close"&&r.info==="auto"&&u++}}function a0(e){let u=0;for(let t=e.length-1;t>=0;t--){const r=e[t];r.type==="text"&&!u&&tt.test(r.content)&&(r.content=r.content.replace(/\\+-/g,"\xB1").replace(/\\.{2,}/g,"\u2026").replace(/([?!])\u2026/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---(?=[^-]|$)/mg,"$1\u2014").replace(/(^|\\s)--(?=\\s|$)/mg,"$1\u2013").replace(/(^|[^-\\s])--(?=[^-\\s]|$)/mg,"$1\u2013")),r.type==="link_open"&&r.info==="auto"&&u--,r.type==="link_close"&&r.info==="auto"&&u++}}function c0(e){let u;if(e.md.options.typographer)for(u=e.tokens.length-1;u>=0;u--)e.tokens[u].type==="inline"&&(u0.test(e.tokens[u].content)&&o0(e.tokens[u].children),tt.test(e.tokens[u].content)&&a0(e.tokens[u].children))}const s0=/[\'"]/,rt=/[\'"]/g,nt="\u2019";function Pe(e,u,t,r){e[u]||(e[u]=[]),e[u].push({pos:t,ch:r})}function l0(e,u){let t="",r=0;u.sort((n,o)=>n.pos-o.pos);for(let n=0;n<u.length;n++){const o=u[n];t+=e.slice(r,o.pos)+o.ch,r=o.pos+1}return t+e.slice(r)}function i0(e,u){let t;const r=[],n={};for(let o=0;o<e.length;o++){const c=e[o],s=e[o].level;for(t=r.length-1;t>=0&&!(r[t].level<=s);t--);if(r.length=t+1,c.type!=="text")continue;const l=c.content;let i=0;const d=l.length;e:for(;i<d;){rt.lastIndex=i;const f=rt.exec(l);if(!f)break;let b=!0,h=!0;i=f.index+1;const p=f[0]==="\'";let k=32;if(f.index-1>=0)k=l.charCodeAt(f.index-1);else for(t=o-1;t>=0&&!(e[t].type==="softbreak"||e[t].type==="hardbreak");t--)if(e[t].content){k=e[t].content.charCodeAt(e[t].content.length-1);break}let y=32;if(i<d)y=l.charCodeAt(i);else for(t=o+1;t<e.length&&!(e[t].type==="softbreak"||e[t].type==="hardbreak");t++)if(e[t].content){y=e[t].content.charCodeAt(0);break}const D=ye(k)||me(k),x=ye(y)||me(y),m=ge(k),_=ge(y);if(_?b=!1:x&&(m||D||(b=!1)),m?h=!1:D&&(_||x||(h=!1)),y===34&&f[0]===\'"\'&&k>=48&&k<=57&&(h=b=!1),b&&h&&(b=D,h=x),!b&&!h){p&&Pe(n,o,f.index,nt);continue}if(h)for(t=r.length-1;t>=0;t--){let v=r[t];if(r[t].level<s)break;if(v.single===p&&r[t].level===s){v=r[t];let w,N;p?(w=u.md.options.quotes[2],N=u.md.options.quotes[3]):(w=u.md.options.quotes[0],N=u.md.options.quotes[1]),Pe(n,o,f.index,N),Pe(n,v.token,v.pos,w),r.length=t;continue e}}b?r.push({token:o,pos:f.index,single:p,level:s}):h&&p&&Pe(n,o,f.index,nt)}}Object.keys(n).forEach(function(o){e[o].content=l0(e[o].content,n[o])})}function d0(e){if(e.md.options.typographer)for(let u=e.tokens.length-1;u>=0;u--)e.tokens[u].type!=="inline"||!s0.test(e.tokens[u].content)||i0(e.tokens[u].children,e)}function f0(e){let u,t;const r=e.tokens,n=r.length;for(let o=0;o<n;o++){if(r[o].type!=="inline")continue;const c=r[o].children,s=c.length;for(u=0;u<s;u++)c[u].type==="text_special"&&(c[u].type="text");for(u=t=0;u<s;u++)c[u].type==="text"&&u+1<s&&c[u+1].type==="text"?c[u+1].content=c[u].content+c[u+1].content:(u!==t&&(c[t]=c[u]),t++);u!==t&&(c.length=t)}}const Ye=[["normalize",Jn],["block",Qn],["inline",Kn],["linkify",e0],["replacements",c0],["smartquotes",d0],["text_join",f0]];function Re(){this.ruler=new q;for(let e=0;e<Ye.length;e++)this.ruler.push(Ye[e][0],Ye[e][1])}Re.prototype.process=function(e){const u=this.ruler.getRules("");for(let t=0,r=u.length;t<r;t++)u[t](e)},Re.prototype.State=ut;function J(e,u,t,r){this.src=e,this.md=u,this.env=t,this.tokens=r,this.bMarks=[],this.eMarks=[],this.tShift=[],this.sCount=[],this.bsCount=[],this.blkIndent=0,this.line=0,this.lineMax=0,this.tight=!1,this.ddIndent=-1,this.listIndent=-1,this.parentType="root",this.level=0;const n=this.src;for(let o=0,c=0,s=0,l=0,i=n.length,d=!1;c<i;c++){const f=n.charCodeAt(c);if(!d)if(M(f)){s++,f===9?l+=4-l%4:l++;continue}else d=!0;(f===10||c===i-1)&&(f!==10&&c++,this.bMarks.push(o),this.eMarks.push(c),this.tShift.push(s),this.sCount.push(l),this.bsCount.push(0),d=!1,s=0,l=0,o=c+1)}this.bMarks.push(n.length),this.eMarks.push(n.length),this.tShift.push(0),this.sCount.push(0),this.bsCount.push(0),this.lineMax=this.bMarks.length-1}J.prototype.push=function(e,u,t){const r=new U(e,u,t);return r.block=!0,t<0&&this.level--,r.level=this.level,t>0&&this.level++,this.tokens.push(r),r},J.prototype.isEmpty=function(u){return this.bMarks[u]+this.tShift[u]>=this.eMarks[u]},J.prototype.skipEmptyLines=function(u){for(let t=this.lineMax;u<t&&!(this.bMarks[u]+this.tShift[u]<this.eMarks[u]);u++);return u},J.prototype.skipSpaces=function(u){for(let t=this.src.length;u<t;u++){const r=this.src.charCodeAt(u);if(!M(r))break}return u},J.prototype.skipSpacesBack=function(u,t){if(u<=t)return u;for(;u>t;)if(!M(this.src.charCodeAt(--u)))return u+1;return u},J.prototype.skipChars=function(u,t){for(let r=this.src.length;u<r&&this.src.charCodeAt(u)===t;u++);return u},J.prototype.skipCharsBack=function(u,t,r){if(u<=r)return u;for(;u>r;)if(t!==this.src.charCodeAt(--u))return u+1;return u},J.prototype.getLines=function(u,t,r,n){if(u>=t)return"";const o=new Array(t-u);for(let c=0,s=u;s<t;s++,c++){let l=0;const i=this.bMarks[s];let d=i,f;for(s+1<t||n?f=this.eMarks[s]+1:f=this.eMarks[s];d<f&&l<r;){const b=this.src.charCodeAt(d);if(M(b))b===9?l+=4-(l+this.bsCount[s])%4:l++;else if(d-i<this.tShift[s])l++;else break;d++}l>r?o[c]=new Array(l-r+1).join(" ")+this.src.slice(d,f):o[c]=this.src.slice(d,f)}return o.join("")},J.prototype.Token=U;const p0=65536;function eu(e,u){const t=e.bMarks[u]+e.tShift[u],r=e.eMarks[u];return e.src.slice(t,r)}function ot(e){const u=[],t=e.length;let r=0,n=e.charCodeAt(r),o=!1,c=0,s="";for(;r<t;)n===124&&(o?(s+=e.substring(c,r-1),c=r):(u.push(s+e.substring(c,r)),s="",c=r+1)),o=n===92,r++,n=e.charCodeAt(r);return u.push(s+e.substring(c)),u}function h0(e,u,t,r){if(u+2>t)return!1;let n=u+1;if(e.sCount[n]<e.blkIndent||e.sCount[n]-e.blkIndent>=4)return!1;let o=e.bMarks[n]+e.tShift[n];if(o>=e.eMarks[n])return!1;const c=e.src.charCodeAt(o++);if(c!==124&&c!==45&&c!==58||o>=e.eMarks[n])return!1;const s=e.src.charCodeAt(o++);if(s!==124&&s!==45&&s!==58&&!M(s)||c===45&&M(s))return!1;for(;o<e.eMarks[n];){const _=e.src.charCodeAt(o);if(_!==124&&_!==45&&_!==58&&!M(_))return!1;o++}let l=eu(e,u+1),i=l.split("|");const d=[];for(let _=0;_<i.length;_++){const v=i[_].trim();if(!v){if(_===0||_===i.length-1)continue;return!1}if(!/^:?-+:?$/.test(v))return!1;v.charCodeAt(v.length-1)===58?d.push(v.charCodeAt(0)===58?"center":"right"):v.charCodeAt(0)===58?d.push("left"):d.push("")}if(l=eu(e,u).trim(),l.indexOf("|")===-1||e.sCount[u]-e.blkIndent>=4)return!1;i=ot(l),i.length&&i[0]===""&&i.shift(),i.length&&i[i.length-1]===""&&i.pop();const f=i.length;if(f===0||f!==d.length)return!1;if(r)return!0;const b=e.parentType;e.parentType="table";const h=e.md.block.ruler.getRules("blockquote"),p=e.push("table_open","table",1),k=[u,0];p.map=k;const y=e.push("thead_open","thead",1);y.map=[u,u+1];const D=e.push("tr_open","tr",1);D.map=[u,u+1];for(let _=0;_<i.length;_++){const v=e.push("th_open","th",1);d[_]&&(v.attrs=[["style","text-align:"+d[_]]]);const w=e.push("inline","",0);w.content=i[_].trim(),w.children=[],e.push("th_close","th",-1)}e.push("tr_close","tr",-1),e.push("thead_close","thead",-1);let x,m=0;for(n=u+2;n<t&&!(e.sCount[n]<e.blkIndent);n++){let _=!1;for(let w=0,N=h.length;w<N;w++)if(h[w](e,n,t,!0)){_=!0;break}if(_||(l=eu(e,n).trim(),!l)||e.sCount[n]-e.blkIndent>=4||(i=ot(l),i.length&&i[0]===""&&i.shift(),i.length&&i[i.length-1]===""&&i.pop(),m+=f-i.length,m>p0))break;if(n===u+2){const w=e.push("tbody_open","tbody",1);w.map=x=[u+2,0]}const v=e.push("tr_open","tr",1);v.map=[n,n+1];for(let w=0;w<f;w++){const N=e.push("td_open","td",1);d[w]&&(N.attrs=[["style","text-align:"+d[w]]]);const F=e.push("inline","",0);F.content=i[w]?i[w].trim():"",F.children=[],e.push("td_close","td",-1)}e.push("tr_close","tr",-1)}return x&&(e.push("tbody_close","tbody",-1),x[1]=n),e.push("table_close","table",-1),k[1]=n,e.parentType=b,e.line=n,!0}function b0(e,u,t){if(e.sCount[u]-e.blkIndent<4)return!1;let r=u+1,n=r;for(;r<t;){if(e.isEmpty(r)){r++;continue}if(e.sCount[r]-e.blkIndent>=4){r++,n=r;continue}break}e.line=n;const o=e.push("code_block","code",0);return o.content=e.getLines(u,n,4+e.blkIndent,!1)+`\n`,o.map=[u,e.line],!0}function x0(e,u,t,r){let n=e.bMarks[u]+e.tShift[u],o=e.eMarks[u];if(e.sCount[u]-e.blkIndent>=4||n+3>o)return!1;const c=e.src.charCodeAt(n);if(c!==126&&c!==96)return!1;let s=n;n=e.skipChars(n,c);let l=n-s;if(l<3)return!1;const i=e.src.slice(s,n),d=e.src.slice(n,o);if(c===96&&d.indexOf(String.fromCharCode(c))>=0)return!1;if(r)return!0;let f=u,b=!1;for(;f++,!(f>=t||(n=s=e.bMarks[f]+e.tShift[f],o=e.eMarks[f],n<o&&e.sCount[f]<e.blkIndent));)if(e.src.charCodeAt(n)===c&&!(e.sCount[f]-e.blkIndent>=4)&&(n=e.skipChars(n,c),!(n-s<l)&&(n=e.skipSpaces(n),!(n<o)))){b=!0;break}l=e.sCount[u],e.line=f+(b?1:0);const h=e.push("fence","code",0);return h.info=d,h.content=e.getLines(u+1,f,l,!0),h.markup=i,h.map=[u,e.line],!0}function g0(e,u,t,r){let n=e.bMarks[u]+e.tShift[u],o=e.eMarks[u];const c=e.lineMax;if(e.sCount[u]-e.blkIndent>=4||e.src.charCodeAt(n)!==62)return!1;if(r)return!0;const s=[],l=[],i=[],d=[],f=e.md.block.ruler.getRules("blockquote"),b=e.parentType;e.parentType="blockquote";let h=!1,p;for(p=u;p<t;p++){const m=e.sCount[p]<e.blkIndent;if(n=e.bMarks[p]+e.tShift[p],o=e.eMarks[p],n>=o)break;if(e.src.charCodeAt(n++)===62&&!m){let v=e.sCount[p]+1,w,N;e.src.charCodeAt(n)===32?(n++,v++,N=!1,w=!0):e.src.charCodeAt(n)===9?(w=!0,(e.bsCount[p]+v)%4===3?(n++,v++,N=!1):N=!0):w=!1;let F=v;for(s.push(e.bMarks[p]),e.bMarks[p]=n;n<o;){const E=e.src.charCodeAt(n);if(M(E))E===9?F+=4-(F+e.bsCount[p]+(N?1:0))%4:F++;else break;n++}h=n>=o,l.push(e.bsCount[p]),e.bsCount[p]=e.sCount[p]+1+(w?1:0),i.push(e.sCount[p]),e.sCount[p]=F-v,d.push(e.tShift[p]),e.tShift[p]=n-e.bMarks[p];continue}if(h)break;let _=!1;for(let v=0,w=f.length;v<w;v++)if(f[v](e,p,t,!0)){_=!0;break}if(_){e.lineMax=p,e.blkIndent!==0&&(s.push(e.bMarks[p]),l.push(e.bsCount[p]),d.push(e.tShift[p]),i.push(e.sCount[p]),e.sCount[p]-=e.blkIndent);break}s.push(e.bMarks[p]),l.push(e.bsCount[p]),d.push(e.tShift[p]),i.push(e.sCount[p]),e.sCount[p]=-1}const k=e.blkIndent;e.blkIndent=0;const y=e.push("blockquote_open","blockquote",1);y.markup=">";const D=[u,0];y.map=D,e.md.block.tokenize(e,u,p);const x=e.push("blockquote_close","blockquote",-1);x.markup=">",e.lineMax=c,e.parentType=b,D[1]=e.line;for(let m=0;m<d.length;m++)e.bMarks[m+u]=s[m],e.tShift[m+u]=d[m],e.sCount[m+u]=i[m],e.bsCount[m+u]=l[m];return e.blkIndent=k,!0}function m0(e,u,t,r){const n=e.eMarks[u];if(e.sCount[u]-e.blkIndent>=4)return!1;let o=e.bMarks[u]+e.tShift[u];const c=e.src.charCodeAt(o++);if(c!==42&&c!==45&&c!==95)return!1;let s=1;for(;o<n;){const i=e.src.charCodeAt(o++);if(i!==c&&!M(i))return!1;i===c&&s++}if(s<3)return!1;if(r)return!0;e.line=u+1;const l=e.push("hr","hr",0);return l.map=[u,e.line],l.markup=Array(s+1).join(String.fromCharCode(c)),!0}function at(e,u){const t=e.eMarks[u];let r=e.bMarks[u]+e.tShift[u];const n=e.src.charCodeAt(r++);if(n!==42&&n!==45&&n!==43)return-1;if(r<t){const o=e.src.charCodeAt(r);if(!M(o))return-1}return r}function ct(e,u){const t=e.bMarks[u]+e.tShift[u],r=e.eMarks[u];let n=t;if(n+1>=r)return-1;let o=e.src.charCodeAt(n++);if(o<48||o>57)return-1;for(;;){if(n>=r)return-1;if(o=e.src.charCodeAt(n++),o>=48&&o<=57){if(n-t>=10)return-1;continue}if(o===41||o===46)break;return-1}return n<r&&(o=e.src.charCodeAt(n),!M(o))?-1:n}function y0(e,u){const t=e.level+2;for(let r=u+2,n=e.tokens.length-2;r<n;r++)e.tokens[r].level===t&&e.tokens[r].type==="paragraph_open"&&(e.tokens[r+2].hidden=!0,e.tokens[r].hidden=!0,r+=2)}function k0(e,u,t,r){let n,o,c,s,l=u,i=!0;if(e.sCount[l]-e.blkIndent>=4||e.listIndent>=0&&e.sCount[l]-e.listIndent>=4&&e.sCount[l]<e.blkIndent)return!1;let d=!1;r&&e.parentType==="paragraph"&&e.sCount[l]>=e.blkIndent&&(d=!0);let f,b,h;if((h=ct(e,l))>=0){if(f=!0,c=e.bMarks[l]+e.tShift[l],b=Number(e.src.slice(c,h-1)),d&&b!==1)return!1}else if((h=at(e,l))>=0)f=!1;else return!1;if(d&&e.skipSpaces(h)>=e.eMarks[l])return!1;if(r)return!0;const p=e.src.charCodeAt(h-1),k=e.tokens.length;f?(s=e.push("ordered_list_open","ol",1),b!==1&&(s.attrs=[["start",b]])):s=e.push("bullet_list_open","ul",1);const y=[l,0];s.map=y,s.markup=String.fromCharCode(p);let D=!1;const x=e.md.block.ruler.getRules("list"),m=e.parentType;for(e.parentType="list";l<t;){o=h,n=e.eMarks[l];const _=e.sCount[l]+h-(e.bMarks[l]+e.tShift[l]);let v=_;for(;o<n;){const z=e.src.charCodeAt(o);if(z===9)v+=4-(v+e.bsCount[l])%4;else if(z===32)v++;else break;o++}const w=o;let N;w>=n?N=1:N=v-_,N>4&&(N=1);const F=_+N;s=e.push("list_item_open","li",1),s.markup=String.fromCharCode(p);const E=[l,0];s.map=E,f&&(s.info=e.src.slice(c,h-1));const A=e.tight,S=e.tShift[l],T=e.sCount[l],L=e.listIndent;if(e.listIndent=e.blkIndent,e.blkIndent=F,e.tight=!0,e.tShift[l]=w-e.bMarks[l],e.sCount[l]=v,w>=n&&e.isEmpty(l+1)?e.line=Math.min(e.line+2,t):e.md.block.tokenize(e,l,t,!0),(!e.tight||D)&&(i=!1),D=e.line-l>1&&e.isEmpty(e.line-1),e.blkIndent=e.listIndent,e.listIndent=L,e.tShift[l]=S,e.sCount[l]=T,e.tight=A,s=e.push("list_item_close","li",-1),s.markup=String.fromCharCode(p),l=e.line,E[1]=l,l>=t||e.sCount[l]<e.blkIndent||e.sCount[l]-e.blkIndent>=4)break;let I=!1;for(let z=0,pe=x.length;z<pe;z++)if(x[z](e,l,t,!0)){I=!0;break}if(I)break;if(f){if(h=ct(e,l),h<0)break;c=e.bMarks[l]+e.tShift[l]}else if(h=at(e,l),h<0)break;if(p!==e.src.charCodeAt(h-1))break}return f?s=e.push("ordered_list_close","ol",-1):s=e.push("bullet_list_close","ul",-1),s.markup=String.fromCharCode(p),y[1]=l,e.line=l,e.parentType=m,i&&y0(e,k),!0}function v0(e,u,t,r){let n=e.bMarks[u]+e.tShift[u],o=e.eMarks[u],c=u+1;if(e.sCount[u]-e.blkIndent>=4||e.src.charCodeAt(n)!==91)return!1;function s(x){const m=e.lineMax;if(x>=m||e.isEmpty(x))return null;let _=!1;if(e.sCount[x]-e.blkIndent>3&&(_=!0),e.sCount[x]<0&&(_=!0),!_){const N=e.md.block.ruler.getRules("reference"),F=e.parentType;e.parentType="reference";let E=!1;for(let A=0,S=N.length;A<S;A++)if(N[A](e,x,m,!0)){E=!0;break}if(e.parentType=F,E)return null}const v=e.bMarks[x]+e.tShift[x],w=e.eMarks[x];return e.src.slice(v,w+1)}let l=e.src.slice(n,o+1);o=l.length;let i=-1;for(n=1;n<o;n++){const x=l.charCodeAt(n);if(x===91)return!1;if(x===93){i=n;break}else if(x===10){const m=s(c);m!==null&&(l+=m,o=l.length,c++)}else if(x===92&&(n++,n<o&&l.charCodeAt(n)===10)){const m=s(c);m!==null&&(l+=m,o=l.length,c++)}}if(i<0||l.charCodeAt(i+1)!==58)return!1;for(n=i+2;n<o;n++){const x=l.charCodeAt(n);if(x===10){const m=s(c);m!==null&&(l+=m,o=l.length,c++)}else if(!M(x))break}const d=e.md.helpers.parseLinkDestination(l,n,o);if(!d.ok)return!1;const f=e.md.normalizeLink(d.str);if(!e.md.validateLink(f))return!1;n=d.pos;const b=n,h=c,p=n;for(;n<o;n++){const x=l.charCodeAt(n);if(x===10){const m=s(c);m!==null&&(l+=m,o=l.length,c++)}else if(!M(x))break}let k=e.md.helpers.parseLinkTitle(l,n,o);for(;k.can_continue;){const x=s(c);if(x===null)break;l+=x,n=o,o=l.length,c++,k=e.md.helpers.parseLinkTitle(l,n,o,k)}let y;for(n<o&&p!==n&&k.ok?(y=k.str,n=k.pos):(y="",n=b,c=h);n<o;){const x=l.charCodeAt(n);if(!M(x))break;n++}if(n<o&&l.charCodeAt(n)!==10&&y)for(y="",n=b,c=h;n<o;){const x=l.charCodeAt(n);if(!M(x))break;n++}if(n<o&&l.charCodeAt(n)!==10)return!1;const D=Me(l.slice(1,i));return D?(r||(typeof e.env.references>"u"&&(e.env.references={}),typeof e.env.references[D]>"u"&&(e.env.references[D]={title:y,href:f}),e.line=c),!0):!1}const w0=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],_0="[a-zA-Z_:][a-zA-Z0-9:._-]*",C0="(?:"+"[^\\"\'=<>`\\\\x00-\\\\x20]+"+"|"+"\'[^\']*\'"+"|"+\'"[^"]*"\'+")",st="<[A-Za-z][A-Za-z0-9\\\\-]*"+("(?:\\\\s+"+_0+"(?:\\\\s*=\\\\s*"+C0+")?)")+"*\\\\s*\\\\/?>",lt="<\\\\/[A-Za-z][A-Za-z0-9\\\\-]*\\\\s*>",E0="<!---?>|<!--(?:[^-]|-[^-]|--[^>])*-->",D0="<[?][\\\\s\\\\S]*?[?]>",A0="<![A-Za-z][^>]*>",F0="<!\\\\[CDATA\\\\[[\\\\s\\\\S]*?\\\\]\\\\]>",N0=new RegExp("^(?:"+st+"|"+lt+"|"+E0+"|"+D0+"|"+A0+"|"+F0+")"),S0=new RegExp("^(?:"+st+"|"+lt+")"),oe=[[/^<(script|pre|style|textarea)(?=(\\s|>|$))/i,/<\\/(script|pre|style|textarea)>/i,!0],[/^<!--/,/-->/,!0],[/^<\\?/,/\\?>/,!0],[/^<![A-Z]/,/>/,!0],[/^<!\\[CDATA\\[/,/\\]\\]>/,!0],[new RegExp("^</?("+w0.join("|")+")(?=(\\\\s|/?>|$))","i"),/^$/,!0],[new RegExp(S0.source+"\\\\s*$"),/^$/,!1]];function T0(e,u,t,r){let n=e.bMarks[u]+e.tShift[u],o=e.eMarks[u];if(e.sCount[u]-e.blkIndent>=4||!e.md.options.html||e.src.charCodeAt(n)!==60)return!1;let c=e.src.slice(n,o),s=0;for(;s<oe.length&&!oe[s][0].test(c);s++);if(s===oe.length)return!1;if(r)return oe[s][2];let l=u+1;const i=oe[s][1].test("");if(!oe[s][1].test(c)){for(;l<t&&!(e.sCount[l]<e.blkIndent&&(i||!e.isEmpty(l)));l++)if(n=e.bMarks[l]+e.tShift[l],o=e.eMarks[l],c=e.src.slice(n,o),oe[s][1].test(c)){c.length!==0&&l++;break}}e.line=l;const d=e.push("html_block","",0);return d.map=[u,l],d.content=e.getLines(u,l,e.blkIndent,!0),!0}function I0(e,u,t,r){let n=e.bMarks[u]+e.tShift[u],o=e.eMarks[u];if(e.sCount[u]-e.blkIndent>=4)return!1;let c=e.src.charCodeAt(n);if(c!==35||n>=o)return!1;let s=1;for(c=e.src.charCodeAt(++n);c===35&&n<o&&s<=6;)s++,c=e.src.charCodeAt(++n);if(s>6||n<o&&!M(c))return!1;if(r)return!0;o=e.skipSpacesBack(o,n);const l=e.skipCharsBack(o,35,n);l>n&&M(e.src.charCodeAt(l-1))&&(o=l),e.line=u+1;const i=e.push("heading_open","h"+String(s),1);i.markup="########".slice(0,s),i.map=[u,e.line];const d=e.push("inline","",0);d.content=Le(e.src.slice(n,o)),d.map=[u,e.line],d.children=[];const f=e.push("heading_close","h"+String(s),-1);return f.markup="########".slice(0,s),!0}function M0(e,u,t){const r=e.md.block.ruler.getRules("paragraph");if(e.sCount[u]-e.blkIndent>=4)return!1;const n=e.parentType;e.parentType="paragraph";let o=0,c,s=u+1;for(;s<t&&!e.isEmpty(s);s++){if(e.sCount[s]-e.blkIndent>3)continue;if(e.sCount[s]>=e.blkIndent){let h=e.bMarks[s]+e.tShift[s];const p=e.eMarks[s];if(h<p&&(c=e.src.charCodeAt(h),(c===45||c===61)&&(h=e.skipChars(h,c),h=e.skipSpaces(h),h>=p))){o=c===61?1:2;break}}if(e.sCount[s]<0)continue;let b=!1;for(let h=0,p=r.length;h<p;h++)if(r[h](e,s,t,!0)){b=!0;break}if(b)break}if(!o)return e.parentType=n,!1;const l=Le(e.getLines(u,s,e.blkIndent,!1));e.line=s+1;const i=e.push("heading_open","h"+String(o),1);i.markup=String.fromCharCode(c),i.map=[u,e.line];const d=e.push("inline","",0);d.content=l,d.map=[u,e.line-1],d.children=[];const f=e.push("heading_close","h"+String(o),-1);return f.markup=String.fromCharCode(c),e.parentType=n,!0}function L0(e,u,t){const r=e.md.block.ruler.getRules("paragraph"),n=e.parentType;let o=u+1;for(e.parentType="paragraph";o<t&&!e.isEmpty(o);o++){if(e.sCount[o]-e.blkIndent>3||e.sCount[o]<0)continue;let i=!1;for(let d=0,f=r.length;d<f;d++)if(r[d](e,o,t,!0)){i=!0;break}if(i)break}const c=Le(e.getLines(u,o,e.blkIndent,!1));e.line=o;const s=e.push("paragraph_open","p",1);s.map=[u,e.line];const l=e.push("inline","",0);return l.content=c,l.map=[u,e.line],l.children=[],e.push("paragraph_close","p",-1),e.parentType=n,!0}const Be=[["table",h0,["paragraph","reference"]],["code",b0],["fence",x0,["paragraph","reference","blockquote","list"]],["blockquote",g0,["paragraph","reference","blockquote","list"]],["hr",m0,["paragraph","reference","blockquote","list"]],["list",k0,["paragraph","reference","blockquote"]],["reference",v0],["html_block",T0,["paragraph","reference","blockquote"]],["heading",I0,["paragraph","reference","blockquote"]],["lheading",M0],["paragraph",L0]];function $e(){this.ruler=new q;for(let e=0;e<Be.length;e++)this.ruler.push(Be[e][0],Be[e][1],{alt:(Be[e][2]||[]).slice()})}$e.prototype.tokenize=function(e,u,t){const r=this.ruler.getRules(""),n=r.length,o=e.md.options.maxNesting;let c=u,s=!1;for(;c<t&&(e.line=c=e.skipEmptyLines(c),!(c>=t||e.sCount[c]<e.blkIndent));){if(e.level>=o){e.line=t;break}const l=e.line;let i=!1;for(let d=0;d<n;d++)if(i=r[d](e,c,t,!1),i){if(l>=e.line)throw new Error("block rule didn\'t increment state.line");break}if(!i)throw new Error("none of the block rules matched");e.tight=!s,e.isEmpty(e.line-1)&&(s=!0),c=e.line,c<t&&e.isEmpty(c)&&(s=!0,c++,e.line=c)}},$e.prototype.parse=function(e,u,t,r){if(!e)return;const n=new this.State(e,u,t,r);this.tokenize(n,n.line,n.lineMax)},$e.prototype.State=J;function ke(e,u,t,r){this.src=e,this.env=t,this.md=u,this.tokens=r,this.tokens_meta=Array(r.length),this.pos=0,this.posMax=this.src.length,this.level=0,this.pending="",this.pendingLevel=0,this.cache={},this.delimiters=[],this._prev_delimiters=[],this.backticks={},this.backticksScanned=!1,this.linkLevel=0}ke.prototype.pushPending=function(){const e=new U("text","",0);return e.content=this.pending,e.level=this.pendingLevel,this.tokens.push(e),this.pending="",e},ke.prototype.push=function(e,u,t){this.pending&&this.pushPending();const r=new U(e,u,t);let n=null;return t<0&&(this.level--,this.delimiters=this._prev_delimiters.pop()),r.level=this.level,t>0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],n={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(r),this.tokens_meta.push(n),r},ke.prototype.scanDelims=function(e,u){const t=this.posMax,r=this.src.charCodeAt(e);let n;if(e===0)n=32;else if(e===1)n=this.src.charCodeAt(0),(n&63488)===55296&&(n=65533);else if(n=this.src.charCodeAt(e-1),(n&64512)===56320){const y=this.src.charCodeAt(e-2);n=(y&64512)===55296?65536+(y-55296<<10)+(n-56320):65533}else(n&64512)===55296&&(n=65533);let o=e;for(;o<t&&this.src.charCodeAt(o)===r;)o++;const c=o-e;let s=o<t?this.src.charCodeAt(o):32;if((s&64512)===55296){const y=this.src.charCodeAt(o+1);s=(y&64512)===56320?65536+(s-55296<<10)+(y-56320):65533}else(s&64512)===56320&&(s=65533);const l=ye(n)||me(n),i=ye(s)||me(s),d=ge(n),f=ge(s),b=!f&&(!i||d||l),h=!d&&(!l||f||i);return{can_open:b&&(u||!h||l),can_close:h&&(u||!b||i),length:c}},ke.prototype.Token=U;function P0(e){switch(e){case 10:case 33:case 35:case 36:case 37:case 38:case 42:case 43:case 45:case 58:case 60:case 61:case 62:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 125:case 126:return!0;default:return!1}}function B0(e,u){let t=e.pos;for(;t<e.posMax&&!P0(e.src.charCodeAt(t));)t++;return t===e.pos?!1:(u||(e.pending+=e.src.slice(e.pos,t)),e.pos=t,!0)}const $0=/(?:^|[^a-z0-9.+-])([a-z][a-z0-9.+-]*)$/i;function O0(e,u){if(!e.md.options.linkify||e.linkLevel>0)return!1;const t=e.pos,r=e.posMax;if(t+3>r||e.src.charCodeAt(t)!==58||e.src.charCodeAt(t+1)!==47||e.src.charCodeAt(t+2)!==47)return!1;const n=e.pending.match($0);if(!n)return!1;const o=n[1],c=e.md.linkify.matchAtStart(e.src.slice(t-o.length));if(!c)return!1;let s=c.url;if(s.length<=o.length)return!1;let l=s.length;for(;l>0&&s.charCodeAt(l-1)===42;)l--;l!==s.length&&(s=s.slice(0,l));const i=e.md.normalizeLink(s);if(!e.md.validateLink(i))return!1;if(!u){e.pending=e.pending.slice(0,-o.length);const d=e.push("link_open","a",1);d.attrs=[["href",i]],d.markup="linkify",d.info="auto";const f=e.push("text","",0);f.content=e.md.normalizeLinkText(s);const b=e.push("link_close","a",-1);b.markup="linkify",b.info="auto"}return e.pos+=s.length-o.length,!0}function z0(e,u){let t=e.pos;if(e.src.charCodeAt(t)!==10)return!1;const r=e.pending.length-1,n=e.posMax;if(!u)if(r>=0&&e.pending.charCodeAt(r)===32)if(r>=1&&e.pending.charCodeAt(r-1)===32){let o=r-1;for(;o>=1&&e.pending.charCodeAt(o-1)===32;)o--;e.pending=e.pending.slice(0,o),e.push("hardbreak","br",0)}else e.pending=e.pending.slice(0,-1),e.push("softbreak","br",0);else e.push("softbreak","br",0);for(t++;t<n&&M(e.src.charCodeAt(t));)t++;return e.pos=t,!0}const uu=[];for(let e=0;e<256;e++)uu.push(0);"\\\\!\\"#$%&\'()*+,./:;<=>?@[]^_`{|}~-".split("").forEach(function(e){uu[e.charCodeAt(0)]=1});function j0(e,u){let t=e.pos;const r=e.posMax;if(e.src.charCodeAt(t)!==92||(t++,t>=r))return!1;let n=e.src.charCodeAt(t);if(n===10){for(u||e.push("hardbreak","br",0),t++;t<r&&(n=e.src.charCodeAt(t),!!M(n));)t++;return e.pos=t,!0}let o=e.src[t];if(n>=55296&&n<=56319&&t+1<r){const s=e.src.charCodeAt(t+1);s>=56320&&s<=57343&&(o+=e.src[t+1],t++)}const c="\\\\"+o;if(!u){const s=e.push("text_special","",0);n<256&&uu[n]!==0?s.content=o:s.content=c,s.markup=c,s.info="escape"}return e.pos=t+1,!0}function q0(e,u){let t=e.pos;if(e.src.charCodeAt(t)!==96)return!1;const n=t;t++;const o=e.posMax;for(;t<o&&e.src.charCodeAt(t)===96;)t++;const c=e.src.slice(n,t),s=c.length;if(e.backticksScanned&&(e.backticks[s]||0)<=n)return u||(e.pending+=c),e.pos+=s,!0;let l=t,i;for(;(i=e.src.indexOf("`",l))!==-1;){for(l=i+1;l<o&&e.src.charCodeAt(l)===96;)l++;const d=l-i;if(d===s){if(!u){const f=e.push("code_inline","code",0);f.markup=c,f.content=e.src.slice(t,i).replace(/\\n/g," ").replace(/^ (.+) $/,"$1")}return e.pos=l,!0}e.backticks[d]=i}return e.backticksScanned=!0,u||(e.pending+=c),e.pos+=s,!0}function H0(e,u){const t=e.pos,r=e.src.charCodeAt(t);if(u||r!==126)return!1;const n=e.scanDelims(e.pos,!0);let o=n.length;const c=String.fromCharCode(r);if(o<2)return!1;let s;o%2&&(s=e.push("text","",0),s.content=c,o--);for(let l=0;l<o;l+=2)s=e.push("text","",0),s.content=c+c,e.delimiters.push({marker:r,length:0,token:e.tokens.length-1,end:-1,open:n.can_open,close:n.can_close});return e.pos+=n.length,!0}function it(e,u){let t;const r=[],n=u.length;for(let o=0;o<n;o++){const c=u[o];if(c.marker!==126||c.end===-1)continue;const s=u[c.end];t=e.tokens[c.token],t.type="s_open",t.tag="s",t.nesting=1,t.markup="~~",t.content="",t=e.tokens[s.token],t.type="s_close",t.tag="s",t.nesting=-1,t.markup="~~",t.content="",e.tokens[s.token-1].type==="text"&&e.tokens[s.token-1].content==="~"&&r.push(s.token-1)}for(;r.length;){const o=r.pop();let c=o+1;for(;c<e.tokens.length&&e.tokens[c].type==="s_close";)c++;c--,o!==c&&(t=e.tokens[c],e.tokens[c]=e.tokens[o],e.tokens[o]=t)}}function Z0(e){const u=e.tokens_meta,t=e.tokens_meta.length;it(e,e.delimiters);for(let r=0;r<t;r++)u[r]&&u[r].delimiters&&it(e,u[r].delimiters)}const dt={tokenize:H0,postProcess:Z0};function V0(e,u){const t=e.pos,r=e.src.charCodeAt(t);if(u||r!==95&&r!==42)return!1;const n=e.scanDelims(e.pos,r===42);for(let o=0;o<n.length;o++){const c=e.push("text","",0);c.content=String.fromCharCode(r),e.delimiters.push({marker:r,length:n.length,token:e.tokens.length-1,end:-1,open:n.can_open,close:n.can_close})}return e.pos+=n.length,!0}function ft(e,u){const t=u.length;for(let r=t-1;r>=0;r--){const n=u[r];if(n.marker!==95&&n.marker!==42||n.end===-1)continue;const o=u[n.end],c=r>0&&u[r-1].end===n.end+1&&u[r-1].marker===n.marker&&u[r-1].token===n.token-1&&u[n.end+1].token===o.token+1,s=String.fromCharCode(n.marker),l=e.tokens[n.token];l.type=c?"strong_open":"em_open",l.tag=c?"strong":"em",l.nesting=1,l.markup=c?s+s:s,l.content="";const i=e.tokens[o.token];i.type=c?"strong_close":"em_close",i.tag=c?"strong":"em",i.nesting=-1,i.markup=c?s+s:s,i.content="",c&&(e.tokens[u[r-1].token].content="",e.tokens[u[n.end+1].token].content="",r--)}}function U0(e){const u=e.tokens_meta,t=e.tokens_meta.length;ft(e,e.delimiters);for(let r=0;r<t;r++)u[r]&&u[r].delimiters&&ft(e,u[r].delimiters)}const pt={tokenize:V0,postProcess:U0};function W0(e,u){let t,r,n,o,c="",s="",l=e.pos,i=!0;if(e.src.charCodeAt(e.pos)!==91)return!1;const d=e.pos,f=e.posMax,b=e.pos+1,h=e.md.helpers.parseLinkLabel(e,e.pos,!0);if(h<0)return!1;let p=h+1;if(p<f&&e.src.charCodeAt(p)===40){for(i=!1,p++;p<f&&(t=e.src.charCodeAt(p),!(!M(t)&&t!==10));p++);if(p>=f)return!1;if(l=p,n=e.md.helpers.parseLinkDestination(e.src,p,e.posMax),n.ok){for(c=e.md.normalizeLink(n.str),e.md.validateLink(c)?p=n.pos:c="",l=p;p<f&&(t=e.src.charCodeAt(p),!(!M(t)&&t!==10));p++);if(n=e.md.helpers.parseLinkTitle(e.src,p,e.posMax),p<f&&l!==p&&n.ok)for(s=n.str,p=n.pos;p<f&&(t=e.src.charCodeAt(p),!(!M(t)&&t!==10));p++);}(p>=f||e.src.charCodeAt(p)!==41)&&(i=!0),p++}if(i){if(typeof e.env.references>"u")return!1;if(p<f&&e.src.charCodeAt(p)===91?(l=p+1,p=e.md.helpers.parseLinkLabel(e,p),p>=0?r=e.src.slice(l,p++):p=h+1):p=h+1,r||(r=e.src.slice(b,h)),o=e.env.references[Me(r)],!o)return e.pos=d,!1;c=o.href,s=o.title}if(!u){e.pos=b,e.posMax=h;const k=e.push("link_open","a",1),y=[["href",c]];k.attrs=y,s&&y.push(["title",s]),e.linkLevel++,e.md.inline.tokenize(e),e.linkLevel--,e.push("link_close","a",-1)}return e.pos=p,e.posMax=f,!0}function G0(e,u){let t,r,n,o,c,s,l,i,d="";const f=e.pos,b=e.posMax;if(e.src.charCodeAt(e.pos)!==33||e.src.charCodeAt(e.pos+1)!==91)return!1;const h=e.pos+2,p=e.md.helpers.parseLinkLabel(e,e.pos+1,!1);if(p<0)return!1;if(o=p+1,o<b&&e.src.charCodeAt(o)===40){for(o++;o<b&&(t=e.src.charCodeAt(o),!(!M(t)&&t!==10));o++);if(o>=b)return!1;for(i=o,s=e.md.helpers.parseLinkDestination(e.src,o,e.posMax),s.ok&&(d=e.md.normalizeLink(s.str),e.md.validateLink(d)?o=s.pos:d=""),i=o;o<b&&(t=e.src.charCodeAt(o),!(!M(t)&&t!==10));o++);if(s=e.md.helpers.parseLinkTitle(e.src,o,e.posMax),o<b&&i!==o&&s.ok)for(l=s.str,o=s.pos;o<b&&(t=e.src.charCodeAt(o),!(!M(t)&&t!==10));o++);else l="";if(o>=b||e.src.charCodeAt(o)!==41)return e.pos=f,!1;o++}else{if(typeof e.env.references>"u")return!1;if(o<b&&e.src.charCodeAt(o)===91?(i=o+1,o=e.md.helpers.parseLinkLabel(e,o),o>=0?n=e.src.slice(i,o++):o=p+1):o=p+1,n||(n=e.src.slice(h,p)),c=e.env.references[Me(n)],!c)return e.pos=f,!1;d=c.href,l=c.title}if(!u){r=e.src.slice(h,p);const k=[];e.md.inline.parse(r,e.md,e.env,k);const y=e.push("image","img",0),D=[["src",d],["alt",""]];y.attrs=D,y.children=k,y.content=r,l&&D.push(["title",l])}return e.pos=o,e.posMax=b,!0}const X0=/^([a-zA-Z0-9.!#$%&\'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)$/,J0=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\\x00-\\x20]*)$/;function Q0(e,u){let t=e.pos;if(e.src.charCodeAt(t)!==60)return!1;const r=e.pos,n=e.posMax;for(;;){if(++t>=n)return!1;const c=e.src.charCodeAt(t);if(c===60)return!1;if(c===62)break}const o=e.src.slice(r+1,t);if(J0.test(o)){const c=e.md.normalizeLink(o);if(!e.md.validateLink(c))return!1;if(!u){const s=e.push("link_open","a",1);s.attrs=[["href",c]],s.markup="autolink",s.info="auto";const l=e.push("text","",0);l.content=e.md.normalizeLinkText(o);const i=e.push("link_close","a",-1);i.markup="autolink",i.info="auto"}return e.pos+=o.length+2,!0}if(X0.test(o)){const c=e.md.normalizeLink("mailto:"+o);if(!e.md.validateLink(c))return!1;if(!u){const s=e.push("link_open","a",1);s.attrs=[["href",c]],s.markup="autolink",s.info="auto";const l=e.push("text","",0);l.content=e.md.normalizeLinkText(o);const i=e.push("link_close","a",-1);i.markup="autolink",i.info="auto"}return e.pos+=o.length+2,!0}return!1}function K0(e){return/^<a[>\\s]/i.test(e)}function Y0(e){return/^<\\/a\\s*>/i.test(e)}function R0(e){const u=e|32;return u>=97&&u<=122}function eo(e,u){if(!e.md.options.html)return!1;const t=e.posMax,r=e.pos;if(e.src.charCodeAt(r)!==60||r+2>=t)return!1;const n=e.src.charCodeAt(r+1);if(n!==33&&n!==63&&n!==47&&!R0(n))return!1;const o=e.src.slice(r).match(N0);if(!o)return!1;if(!u){const c=e.push("html_inline","",0);c.content=o[0],K0(c.content)&&e.linkLevel++,Y0(c.content)&&e.linkLevel--}return e.pos+=o[0].length,!0}const uo=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,to=/^&([a-z][a-z0-9]{1,31});/i;function ro(e,u){const t=e.pos,r=e.posMax;if(e.src.charCodeAt(t)!==38||t+1>=r)return!1;if(e.src.charCodeAt(t+1)===35){const o=e.src.slice(t).match(uo);if(o){if(!u){const c=o[1][0].toLowerCase()==="x"?parseInt(o[1].slice(1),16):parseInt(o[1],10),s=e.push("text_special","",0);s.content=Ke(c)?xe(c):xe(65533),s.markup=o[0],s.info="entity"}return e.pos+=o[0].length,!0}}else{const o=e.src.slice(t).match(to);if(o){const c=An(o[0]);if(c!==o[0]){if(!u){const s=e.push("text_special","",0);s.content=c,s.markup=o[0],s.info="entity"}return e.pos+=o[0].length,!0}}}return!1}function ht(e){const u={},t=e.length;if(!t)return;let r=0,n=-2;const o=[];for(let c=0;c<t;c++){const s=e[c];if(o.push(0),(e[r].marker!==s.marker||n!==s.token-1)&&(r=c),n=s.token,s.length=s.length||0,!s.close)continue;u.hasOwnProperty(s.marker)||(u[s.marker]=[-1,-1,-1,-1,-1,-1]);const l=u[s.marker][(s.open?3:0)+s.length%3];let i=r-o[r]-1,d=i;for(;i>l;i-=o[i]+1){const f=e[i];if(f.marker===s.marker&&f.open&&f.end<0){let b=!1;if((f.close||s.open)&&(f.length+s.length)%3===0&&(f.length%3!==0||s.length%3!==0)&&(b=!0),!b){const h=i>0&&!e[i-1].open?o[i-1]+1:0;o[c]=c-i+h,o[i]=h,s.open=!1,f.end=c,f.close=!1,d=-1,n=-2;break}}}d!==-1&&(u[s.marker][(s.open?3:0)+(s.length||0)%3]=d)}}function no(e){const u=e.tokens_meta,t=e.tokens_meta.length;ht(e.delimiters);for(let r=0;r<t;r++)u[r]&&u[r].delimiters&&ht(u[r].delimiters)}function oo(e){let u,t,r=0;const n=e.tokens,o=e.tokens.length;for(u=t=0;u<o;u++)n[u].nesting<0&&r--,n[u].level=r,n[u].nesting>0&&r++,n[u].type==="text"&&u+1<o&&n[u+1].type==="text"?n[u+1].content=n[u].content+n[u+1].content:(u!==t&&(n[t]=n[u]),t++);u!==t&&(n.length=t)}const tu=[["text",B0],["linkify",O0],["newline",z0],["escape",j0],["backticks",q0],["strikethrough",dt.tokenize],["emphasis",pt.tokenize],["link",W0],["image",G0],["autolink",Q0],["html_inline",eo],["entity",ro]],ru=[["balance_pairs",no],["strikethrough",dt.postProcess],["emphasis",pt.postProcess],["fragments_join",oo]];function ve(){this.ruler=new q;for(let e=0;e<tu.length;e++)this.ruler.push(tu[e][0],tu[e][1]);this.ruler2=new q;for(let e=0;e<ru.length;e++)this.ruler2.push(ru[e][0],ru[e][1])}ve.prototype.skipToken=function(e){const u=e.pos,t=this.ruler.getRules(""),r=t.length,n=e.md.options.maxNesting,o=e.cache;if(typeof o[u]<"u"){e.pos=o[u];return}let c=!1;if(e.level<n){for(let s=0;s<r;s++)if(e.level++,c=t[s](e,!0),e.level--,c){if(u>=e.pos)throw new Error("inline rule didn\'t increment state.pos");break}}else e.pos=e.posMax;c||e.pos++,o[u]=e.pos},ve.prototype.tokenize=function(e){const u=this.ruler.getRules(""),t=u.length,r=e.posMax,n=e.md.options.maxNesting;for(;e.pos<r;){const o=e.pos;let c=!1;if(e.level<n){for(let s=0;s<t;s++)if(c=u[s](e,!1),c){if(o>=e.pos)throw new Error("inline rule didn\'t increment state.pos");break}}if(c){if(e.pos>=r)break;continue}e.pending+=e.src[e.pos++]}e.pending&&e.pushPending()},ve.prototype.parse=function(e,u,t,r){const n=new this.State(e,u,t,r);this.tokenize(n);const o=this.ruler2.getRules(""),c=o.length;for(let s=0;s<c;s++)o[s](n)},ve.prototype.State=ke;function ao(e){const u={};e=e||{},u.src_Any=Uu.source,u.src_Cc=Wu.source,u.src_Z=Xu.source,u.src_P=Ge.source,u.src_ZPCc=[u.src_Z,u.src_P,u.src_Cc].join("|"),u.src_ZCc=[u.src_Z,u.src_Cc].join("|");const t="[><\uFF5C]";return u.src_pseudo_letter="(?:(?!"+t+"|"+u.src_ZPCc+")"+u.src_Any+")",u.src_ip4="(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)",u.src_auth="(?:(?:(?!"+u.src_ZCc+"|[@/\\\\[\\\\]()]).)+@)?",u.src_port="(?::(?:6(?:[0-4]\\\\d{3}|5(?:[0-4]\\\\d{2}|5(?:[0-2]\\\\d|3[0-5])))|[1-5]?\\\\d{1,4}))?",u.src_host_terminator="(?=$|"+t+"|"+u.src_ZPCc+")(?!"+(e["---"]?"-(?!--)|":"-|")+"_|:\\\\d|\\\\.-|\\\\.(?!$|"+u.src_ZPCc+"))",u.src_path="(?:[/?#](?:(?!"+u.src_ZCc+"|"+t+`|[()[\\\\]{}.,"\'?!\\\\-;]).|\\\\[(?:(?!`+u.src_ZCc+"|\\\\]).)*\\\\]|\\\\((?:(?!"+u.src_ZCc+"|[)]).)*\\\\)|\\\\{(?:(?!"+u.src_ZCc+\'|[}]).)*\\\\}|\\\\"(?:(?!\'+u.src_ZCc+`|["]).)+\\\\"|\\\\\'(?:(?!`+u.src_ZCc+"|[\']).)+\\\\\'|\\\\\'(?="+u.src_pseudo_letter+"|[-])|\\\\.{2,}[a-zA-Z0-9%/&]|\\\\.(?!"+u.src_ZCc+"|[.]|$)|"+(e["---"]?"\\\\-(?!--(?:[^-]|$))(?:-*)|":"\\\\-+|")+",(?!"+u.src_ZCc+"|$)|;(?!"+u.src_ZCc+"|$)|\\\\!+(?!"+u.src_ZCc+"|[!]|$)|\\\\?(?!"+u.src_ZCc+"|[?]|$))+|\\\\/)?",u.src_email_name=\'[\\\\-;:&=\\\\+\\\\$,\\\\.a-zA-Z0-9_][\\\\-;:&=\\\\+\\\\$,\\\\"\\\\.a-zA-Z0-9_]*\',u.src_xn="xn--[a-z0-9\\\\-]{1,59}",u.src_domain_root="(?:"+u.src_xn+"|"+u.src_pseudo_letter+"{1,63})",u.src_domain="(?:"+u.src_xn+"|(?:"+u.src_pseudo_letter+")|(?:"+u.src_pseudo_letter+"(?:-|"+u.src_pseudo_letter+"){0,61}"+u.src_pseudo_letter+"))",u.src_host="(?:(?:(?:(?:"+u.src_domain+")\\\\.)*"+u.src_domain+"))",u.tpl_host_fuzzy="(?:"+u.src_ip4+"|(?:(?:(?:"+u.src_domain+")\\\\.)+(?:%TLDS%)))",u.tpl_host_no_ip_fuzzy="(?:(?:(?:"+u.src_domain+")\\\\.)+(?:%TLDS%))",u.src_host_strict=u.src_host+u.src_host_terminator,u.tpl_host_fuzzy_strict=u.tpl_host_fuzzy+u.src_host_terminator,u.src_host_port_strict=u.src_host+u.src_port+u.src_host_terminator,u.tpl_host_port_fuzzy_strict=u.tpl_host_fuzzy+u.src_port+u.src_host_terminator,u.tpl_host_port_no_ip_fuzzy_strict=u.tpl_host_no_ip_fuzzy+u.src_port+u.src_host_terminator,u.tpl_host_fuzzy_test="localhost|www\\\\.|\\\\.\\\\d{1,3}\\\\.|(?:\\\\.(?:%TLDS%)(?:"+u.src_ZPCc+"|>|$))",u.tpl_email_fuzzy="(^|"+t+\'|"|\\\\(|\'+u.src_ZCc+")("+u.src_email_name+"@"+u.tpl_host_fuzzy_strict+")",u.tpl_link_fuzzy="(^|(?![.:/\\\\-_@])(?:[$+<=>^`|\uFF5C]|"+u.src_ZPCc+"))((?![$+<=>^`|\uFF5C])"+u.tpl_host_port_fuzzy_strict+u.src_path+")",u.tpl_link_no_ip_fuzzy="(^|(?![.:/\\\\-_@])(?:[$+<=>^`|\uFF5C]|"+u.src_ZPCc+"))((?![$+<=>^`|\uFF5C])"+u.tpl_host_port_no_ip_fuzzy_strict+u.src_path+")",u}function nu(e){return Array.prototype.slice.call(arguments,1).forEach(function(t){t&&Object.keys(t).forEach(function(r){e[r]=t[r]})}),e}function Oe(e){return Object.prototype.toString.call(e)}function co(e){return Oe(e)==="[object String]"}function so(e){return Oe(e)==="[object Object]"}function lo(e){return Oe(e)==="[object RegExp]"}function bt(e){return Oe(e)==="[object Function]"}function io(e){return e.replace(/[.?*+^$[\\]\\\\(){}|-]/g,"\\\\$&")}const xt={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function fo(e){return Object.keys(e||{}).reduce(function(u,t){return u||xt.hasOwnProperty(t)},!1)}const po={"http:":{validate:function(e,u,t){const r=e.slice(u);return t.re.http||(t.re.http=new RegExp("^\\\\/\\\\/"+t.re.src_auth+t.re.src_host_port_strict+t.re.src_path,"i")),t.re.http.test(r)?r.match(t.re.http)[0].length:0}},"https:":"http:","ftp:":"http:","//":{validate:function(e,u,t){const r=e.slice(u);return t.re.no_http||(t.re.no_http=new RegExp("^"+t.re.src_auth+"(?:localhost|(?:(?:"+t.re.src_domain+")\\\\.)+"+t.re.src_domain_root+")"+t.re.src_port+t.re.src_host_terminator+t.re.src_path,"i")),t.re.no_http.test(r)?u>=3&&e[u-3]===":"||u>=3&&e[u-3]==="/"?0:r.match(t.re.no_http)[0].length:0}},"mailto:":{validate:function(e,u,t){const r=e.slice(u);return t.re.mailto||(t.re.mailto=new RegExp("^"+t.re.src_email_name+"@"+t.re.src_host_strict,"i")),t.re.mailto.test(r)?r.match(t.re.mailto)[0].length:0}}},ho="a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]",bo="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|\u0440\u0444".split("|");function xo(e){return function(u,t){const r=u.slice(t);return e.test(r)?r.match(e)[0].length:0}}function gt(){return function(e,u){u.normalize(e)}}function ze(e){const u=e.re=ao(e.__opts__),t=e.__tlds__.slice();e.onCompile(),e.__tlds_replaced__||t.push(ho),t.push(u.src_xn),u.src_tlds=t.join("|");function r(s){return s.replace("%TLDS%",u.src_tlds)}u.email_fuzzy=RegExp(r(u.tpl_email_fuzzy),"i"),u.email_fuzzy_global=RegExp(r(u.tpl_email_fuzzy),"ig"),u.link_fuzzy=RegExp(r(u.tpl_link_fuzzy),"i"),u.link_fuzzy_global=RegExp(r(u.tpl_link_fuzzy),"ig"),u.link_no_ip_fuzzy=RegExp(r(u.tpl_link_no_ip_fuzzy),"i"),u.link_no_ip_fuzzy_global=RegExp(r(u.tpl_link_no_ip_fuzzy),"ig"),u.host_fuzzy_test=RegExp(r(u.tpl_host_fuzzy_test),"i");const n=[];e.__compiled__={};function o(s,l){throw new Error(\'(LinkifyIt) Invalid schema "\'+s+\'": \'+l)}Object.keys(e.__schemas__).forEach(function(s){const l=e.__schemas__[s];if(l===null)return;const i={validate:null,link:null};if(e.__compiled__[s]=i,so(l)){lo(l.validate)?i.validate=xo(l.validate):bt(l.validate)?i.validate=l.validate:o(s,l),bt(l.normalize)?i.normalize=l.normalize:l.normalize?o(s,l):i.normalize=gt();return}if(co(l)){n.push(s);return}o(s,l)}),n.forEach(function(s){e.__compiled__[e.__schemas__[s]]&&(e.__compiled__[s].validate=e.__compiled__[e.__schemas__[s]].validate,e.__compiled__[s].normalize=e.__compiled__[e.__schemas__[s]].normalize)}),e.__compiled__[""]={validate:null,normalize:gt()};const c=Object.keys(e.__compiled__).filter(function(s){return s.length>0&&e.__compiled__[s]}).map(io).join("|");e.re.schema_test=RegExp("(^|(?!_)(?:[><\uFF5C]|"+u.src_ZPCc+"))("+c+")","i"),e.re.schema_search=RegExp("(^|(?!_)(?:[><\uFF5C]|"+u.src_ZPCc+"))("+c+")","ig"),e.re.schema_at_start=RegExp("^"+e.re.schema_search.source,"i"),e.re.pretest=RegExp("("+e.re.schema_test.source+")|("+e.re.host_fuzzy_test.source+")|@","i")}function mt(e,u,t,r){const n=e.slice(t,r);this.schema=u.toLowerCase(),this.index=t,this.lastIndex=r,this.raw=n,this.text=n,this.url=n}function H(e,u){if(!(this instanceof H))return new H(e,u);u||fo(e)&&(u=e,e={}),this.__opts__=nu({},xt,u),this.__schemas__=nu({},po,e),this.__compiled__={},this.__tlds__=bo,this.__tlds_replaced__=!1,this.re={},ze(this)}H.prototype.add=function(u,t){return this.__schemas__[u]=t,ze(this),this},H.prototype.set=function(u){return this.__opts__=nu(this.__opts__,u),this},H.prototype.test=function(u){if(!u.length)return!1;let t,r;if(this.re.schema_test.test(u)){for(r=this.re.schema_search,r.lastIndex=0;(t=r.exec(u))!==null;)if(this.testSchemaAt(u,t[2],r.lastIndex))return!0}return!!(this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&u.search(this.re.host_fuzzy_test)>=0&&u.match(this.__opts__.fuzzyIP?this.re.link_fuzzy:this.re.link_no_ip_fuzzy)!==null||this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"]&&u.indexOf("@")>=0&&u.match(this.re.email_fuzzy)!==null)},H.prototype.pretest=function(u){return this.re.pretest.test(u)},H.prototype.testSchemaAt=function(u,t,r){return this.__compiled__[t.toLowerCase()]?this.__compiled__[t.toLowerCase()].validate(u,r,this):0},H.prototype.match=function(u){const t=[],r=[],n=[],o=[];let c,s,l;function i(b,h){return b?h?b.index!==h.index?b.index<h.index?b:h:b.lastIndex>=h.lastIndex?b:h:b:h}if(!u.length)return null;if(this.re.schema_test.test(u))for(l=this.re.schema_search,l.lastIndex=0;(c=l.exec(u))!==null;)s=this.testSchemaAt(u,c[2],l.lastIndex),s&&r.push({schema:c[2],index:c.index+c[1].length,lastIndex:c.index+c[0].length+s});if(this.__opts__.fuzzyLink&&this.__compiled__["http:"])for(l=this.__opts__.fuzzyIP?this.re.link_fuzzy_global:this.re.link_no_ip_fuzzy_global,l.lastIndex=0;(c=l.exec(u))!==null;)n.push({schema:"",index:c.index+c[1].length,lastIndex:c.index+c[0].length});if(this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"])for(l=this.re.email_fuzzy_global,l.lastIndex=0;(c=l.exec(u))!==null;)o.push({schema:"mailto:",index:c.index+c[1].length,lastIndex:c.index+c[0].length});const d=[0,0,0];let f=0;for(;;){const b=[r[d[0]],o[d[1]],n[d[2]]],h=i(i(b[0],b[1]),b[2]);if(!h)break;if(h===b[0]?d[0]++:h===b[1]?d[1]++:d[2]++,h.index<f)continue;const p=new mt(u,h.schema,h.index,h.lastIndex);this.__compiled__[p.schema].normalize(p,this),t.push(p),f=h.lastIndex}return t.length?t:null},H.prototype.matchAtStart=function(u){if(!u.length)return null;const t=this.re.schema_at_start.exec(u);if(!t)return null;const r=this.testSchemaAt(u,t[2],t[0].length);if(!r)return null;const n=new mt(u,t[2],t.index+t[1].length,t.index+t[0].length+r);return this.__compiled__[n.schema].normalize(n,this),n},H.prototype.tlds=function(u,t){return u=Array.isArray(u)?u:[u],t?(this.__tlds__=this.__tlds__.concat(u).sort().filter(function(r,n,o){return r!==o[n-1]}).reverse(),ze(this),this):(this.__tlds__=u.slice(),this.__tlds_replaced__=!0,ze(this),this)},H.prototype.normalize=function(u){u.schema||(u.url="http://"+u.url),u.schema==="mailto:"&&!/^mailto:/i.test(u.url)&&(u.url="mailto:"+u.url)},H.prototype.onCompile=function(){};const le=2147483647,Q=36,ou=1,we=26,go=38,mo=700,yt=72,kt=128,vt="-",yo=/^xn--/,ko=/[^\\0-\\x7F]/,vo=/[\\x2E\\u3002\\uFF0E\\uFF61]/g,wo={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},au=Q-ou,K=Math.floor,cu=String.fromCharCode;function ue(e){throw new RangeError(wo[e])}function _o(e,u){const t=[];let r=e.length;for(;r--;)t[r]=u(e[r]);return t}function wt(e,u){const t=e.split("@");let r="";t.length>1&&(r=t[0]+"@",e=t[1]),e=e.replace(vo,".");const n=e.split("."),o=_o(n,u).join(".");return r+o}function _t(e){const u=[];let t=0;const r=e.length;for(;t<r;){const n=e.charCodeAt(t++);if(n>=55296&&n<=56319&&t<r){const o=e.charCodeAt(t++);(o&64512)==56320?u.push(((n&1023)<<10)+(o&1023)+65536):(u.push(n),t--)}else u.push(n)}return u}const Co=e=>String.fromCodePoint(...e),Eo=function(e){return e>=48&&e<58?26+(e-48):e>=65&&e<91?e-65:e>=97&&e<123?e-97:Q},Ct=function(e,u){return e+22+75*(e<26)-((u!=0)<<5)},Et=function(e,u,t){let r=0;for(e=t?K(e/mo):e>>1,e+=K(e/u);e>au*we>>1;r+=Q)e=K(e/au);return K(r+(au+1)*e/(e+go))},Dt=function(e){const u=[],t=e.length;let r=0,n=kt,o=yt,c=e.lastIndexOf(vt);c<0&&(c=0);for(let s=0;s<c;++s)e.charCodeAt(s)>=128&&ue("not-basic"),u.push(e.charCodeAt(s));for(let s=c>0?c+1:0;s<t;){const l=r;for(let d=1,f=Q;;f+=Q){s>=t&&ue("invalid-input");const b=Eo(e.charCodeAt(s++));b>=Q&&ue("invalid-input"),b>K((le-r)/d)&&ue("overflow"),r+=b*d;const h=f<=o?ou:f>=o+we?we:f-o;if(b<h)break;const p=Q-h;d>K(le/p)&&ue("overflow"),d*=p}const i=u.length+1;o=Et(r-l,i,l==0),K(r/i)>le-n&&ue("overflow"),n+=K(r/i),r%=i,u.splice(r++,0,n)}return String.fromCodePoint(...u)},At=function(e){const u=[];e=_t(e);const t=e.length;let r=kt,n=0,o=yt;for(const l of e)l<128&&u.push(cu(l));const c=u.length;let s=c;for(c&&u.push(vt);s<t;){let l=le;for(const d of e)d>=r&&d<l&&(l=d);const i=s+1;l-r>K((le-n)/i)&&ue("overflow"),n+=(l-r)*i,r=l;for(const d of e)if(d<r&&++n>le&&ue("overflow"),d===r){let f=n;for(let b=Q;;b+=Q){const h=b<=o?ou:b>=o+we?we:b-o;if(f<h)break;const p=f-h,k=Q-h;u.push(cu(Ct(h+p%k,0))),f=K(p/k)}u.push(cu(Ct(f,0))),o=Et(n,i,s===c),n=0,++s}++n,++r}return u.join("")},Ft={version:"2.3.1",ucs2:{decode:_t,encode:Co},decode:Dt,encode:At,toASCII:function(e){return wt(e,function(u){return ko.test(u)?"xn--"+At(u):u})},toUnicode:function(e){return wt(e,function(u){return yo.test(u)?Dt(u.slice(4).toLowerCase()):u})}},Do={default:{options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"\u201C\u201D\u2018\u2019",highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}},zero:{options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"\u201C\u201D\u2018\u2019",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["paragraph"]},inline:{rules:["text"],rules2:["balance_pairs","fragments_join"]}}},commonmark:{options:{html:!0,xhtmlOut:!0,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"\u201C\u201D\u2018\u2019",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["blockquote","code","fence","heading","hr","html_block","lheading","list","reference","paragraph"]},inline:{rules:["autolink","backticks","emphasis","entity","escape","html_inline","image","link","newline","text"],rules2:["balance_pairs","emphasis","fragments_join"]}}}},Ao=/^(vbscript|javascript|file|data):/,Fo=/^data:image\\/(gif|png|jpeg|webp);/;function No(e){const u=e.trim().toLowerCase();return Ao.test(u)?Fo.test(u):!0}const Nt=["http:","https:","mailto:"];function So(e){const u=We(e,!0);if(u.hostname&&(!u.protocol||Nt.indexOf(u.protocol)>=0))try{u.hostname=Ft.toASCII(u.hostname)}catch{}return be(Ue(u))}function To(e){const u=We(e,!0);if(u.hostname&&(!u.protocol||Nt.indexOf(u.protocol)>=0))try{u.hostname=Ft.toUnicode(u.hostname)}catch{}return ae(Ue(u),ae.defaultChars+"%")}function V(e,u){if(!(this instanceof V))return new V(e,u);u||Qe(e)||(u=e||{},e="default"),this.inline=new ve,this.block=new $e,this.core=new Re,this.renderer=new se,this.linkify=new H,this.validateLink=No,this.normalizeLink=So,this.normalizeLinkText=To,this.utils=Hn,this.helpers=Ie({},Wn),this.options={},this.configure(e),u&&this.set(u)}V.prototype.set=function(e){return Ie(this.options,e),this},V.prototype.configure=function(e){const u=this;if(Qe(e)){const t=e;if(e=Do[t],!e)throw new Error(\'Wrong `markdown-it` preset "\'+t+\'", check name\')}if(!e)throw new Error("Wrong `markdown-it` preset, can\'t be empty");return e.options&&u.set(e.options),e.components&&Object.keys(e.components).forEach(function(t){e.components[t].rules&&u[t].ruler.enableOnly(e.components[t].rules),e.components[t].rules2&&u[t].ruler2.enableOnly(e.components[t].rules2)}),this},V.prototype.enable=function(e,u){let t=[];Array.isArray(e)||(e=[e]),["core","block","inline"].forEach(function(n){t=t.concat(this[n].ruler.enable(e,!0))},this),t=t.concat(this.inline.ruler2.enable(e,!0));const r=e.filter(function(n){return t.indexOf(n)<0});if(r.length&&!u)throw new Error("MarkdownIt. Failed to enable unknown rule(s): "+r);return this},V.prototype.disable=function(e,u){let t=[];Array.isArray(e)||(e=[e]),["core","block","inline"].forEach(function(n){t=t.concat(this[n].ruler.disable(e,!0))},this),t=t.concat(this.inline.ruler2.disable(e,!0));const r=e.filter(function(n){return t.indexOf(n)<0});if(r.length&&!u)throw new Error("MarkdownIt. Failed to disable unknown rule(s): "+r);return this},V.prototype.use=function(e){const u=[this].concat(Array.prototype.slice.call(arguments,1));return e.apply(e,u),this},V.prototype.parse=function(e,u){if(typeof e!="string")throw new Error("Input data should be a String");const t=new this.core.State(e,this,u);return this.core.process(t),t.tokens},V.prototype.render=function(e,u){return u=u||{},this.renderer.render(this.parse(e,u),this.options,u)},V.prototype.parseInline=function(e,u){const t=new this.core.State(e,this,u);return t.inlineMode=!0,this.core.process(t),t.tokens},V.prototype.renderInline=function(e,u){return u=u||{},this.renderer.render(this.parseInline(e,u),this.options,u)};const su=/(?:[a-zA-Z]:)?[/\\\\](?:[\\w\\-. ]+[/\\\\])+[\\w\\-. ]+\\.(tsx?|jsx?|css|scss|json|md|py|java|go|rs|c|cpp|h|hpp|sh|yaml|yml|toml|xml|html|vue|svelte)/gi,lu=/(?:[a-zA-Z]:)?[/\\\\](?:[\\w\\-. ]+[/\\\\])+[\\w\\-. ]+\\.(tsx?|jsx?|css|scss|json|md|py|java|go|rs|c|cpp|h|hpp|sh|yaml|yml|toml|xml|html|vue|svelte)#(\\d+)(?:-(\\d+))?/gi,Io=/\\.(tsx?|jsx?|css|scss|json|md|py|java|go|rs|c|cpp|h|hpp|sh|ya?ml|toml|xml|html|vue|svelte)$/i,Mo=e=>{try{return decodeURIComponent(e)}catch{return e}},St=e=>{const u=Mo(e).replace(/\\\\/g,"/");if(/^file:\\/\\//i.test(u)){let c=u.replace(/^file:\\/\\/\\//i,"");return!/^[a-zA-Z]:/.test(c)&&!c.startsWith("/")&&(c="/"+c),c}const t=u.indexOf("#");if(t<0)return u;const r=u.slice(0,t),o=u.slice(t+1).match(/^L?(\\d+)(?:-\\d+)?$/i);return o?`${r}:${parseInt(o[1],10)}`:r},Lo=e=>e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/\'/g,"'"),Po=()=>new V({html:!1,xhtmlOut:!1,breaks:!0,linkify:!0,typographer:!0}),_e=({content:e,onFileClick:u,enableFileLinks:t=!0})=>{const r=C.useMemo(()=>Po(),[]),n=s=>{if(typeof document>"u")return s;const l=new RegExp(su.source,su.flags.replace("g","")),i=new RegExp(lu.source,lu.flags.replace("g","")),d=/[\\w\\-. ]+\\.(tsx?|jsx?|css|scss|json|md|py|java|go|rs|c|cpp|h|hpp|sh|ya?ml|toml|xml|html|vue|svelte)/i,f=document.createElement("div");f.innerHTML=s;const b=new RegExp(`${lu.source}|${su.source}|${d.source}`,"gi"),h=x=>{const m=x;let _=x;const v=x.indexOf("#");if(v>=0){const N=x.slice(v+1).match(/^L?(\\d+)(?:-\\d+)?$/i);if(N){const F=parseInt(N[1],10);return _=x.slice(0,v),{displayText:m,dataPath:`${_}:${F}`}}}return{displayText:m,dataPath:_}},p=x=>{const m=document.createElement("a"),{dataPath:_}=h(x);return m.className="file-path-link",m.textContent=x,m.setAttribute("href","#"),m.setAttribute("title",`Open ${x}`),m.setAttribute("data-file-path",_),m},k=x=>d.test(x)||/[/\\\\]/.test(x)?!1:/^[a-zA-Z_$][\\w$]*(\\.[a-zA-Z_$][\\w$]*)+$/.test(x),y=x=>{const m=x.getAttribute("href")||"",_=(x.textContent||"").trim();if(m.match(/^https?:\\/\\/(.+)$/i))try{const N=new URL(m),F=N.hostname||"",E=N.pathname||"",A=E===""||E==="/";if(A&&d.test(_)&&F.toLowerCase()===_.toLowerCase()){const{dataPath:S}=h(_);x.classList.add("file-path-link"),x.setAttribute("href","#"),x.setAttribute("title",`Open ${_}`),x.setAttribute("data-file-path",S);return}if(A&&d.test(F)){const{dataPath:S}=h(F);x.classList.add("file-path-link"),x.setAttribute("href","#"),x.setAttribute("title",`Open ${_||F}`),x.setAttribute("data-file-path",S);return}}catch{}if(/^(https?|mailto|ftp|data):/i.test(m))return;const w=m||_;if(!k(w)){if(i.test(w)||l.test(w)){const{dataPath:N}=h(w);x.classList.add("file-path-link"),x.setAttribute("href","#"),x.setAttribute("title",`Open ${_||m}`),x.setAttribute("data-file-path",N);return}if(d.test(w)){const{dataPath:N}=h(w);x.classList.add("file-path-link"),x.setAttribute("href","#"),x.setAttribute("title",`Open ${_||m}`),x.setAttribute("data-file-path",N)}}},D=x=>{if(x.nodeType===Node.ELEMENT_NODE){const m=x;if(m.tagName.toLowerCase()==="a"){y(m);return}const _=m.tagName.toLowerCase();if(_==="code"||_==="pre")return}for(let m=x.firstChild;m;){const _=m.nextSibling;if(m.nodeType===Node.TEXT_NODE){const v=m.nodeValue||"";b.lastIndex=0;const w=b.test(v);if(b.lastIndex=0,w){const N=document.createDocumentFragment();let F=0,E;for(;E=b.exec(v);){const A=E[0],S=E.index;if(k(A)){S>F&&N.appendChild(document.createTextNode(v.slice(F,S))),N.appendChild(document.createTextNode(A)),F=S+A.length;continue}S>F&&N.appendChild(document.createTextNode(v.slice(F,S))),N.appendChild(p(A)),F=S+A.length}F<v.length&&N.appendChild(document.createTextNode(v.slice(F))),x.replaceChild(N,m)}}else m.nodeType===Node.ELEMENT_NODE&&D(m);m=_}};return D(f),f.innerHTML},o=C.useMemo(()=>{try{let s=r.render(e);return t&&(s=n(s)),s}catch(s){return console.error("Error rendering markdown:",s),Lo(e)}},[e,t,r]),c=C.useCallback(s=>{const l=s.target;if(!l)return;const i=l.closest&&l.closest("a.file-path-link");if(i){const y=i.getAttribute("data-file-path");if(!y)return;s.preventDefault(),s.stopPropagation(),u==null||u(y);return}const d=l.closest&&l.closest("a");if(!d)return;const f=d.getAttribute("href")||"";if(/^file:\\/\\//i.test(f)&&u){const y=St(f);s.preventDefault(),s.stopPropagation(),u(y);return}if(/^(https?|mailto|ftp|data):/i.test(f))return;const b=(d.textContent||"").trim(),h=St(f||b),p=/^(?:[a-zA-Z]:[/\\\\]|[/\\\\])/i.test(h),k=!p&&Io.test(h.replace(/:\\d+(?::\\d+)?$/,""));(p||k)&&u&&(s.preventDefault(),s.stopPropagation(),u(h))},[u]);return a.jsx("div",{className:"markdown-content",onClick:c,dangerouslySetInnerHTML:{__html:o},style:{wordWrap:"break-word",overflowWrap:"break-word",whiteSpace:"normal"}})},Tt=({content:e,onFileClick:u,enableFileLinks:t})=>a.jsx(_e,{content:e,onFileClick:u,enableFileLinks:t});Tt.displayName="MessageContent";const ie=C.memo(Tt),iu="--- Content from referenced files ---",It="--- End of content ---",Bo=/^Content from @([^\\n:]+):\\n?/m;function Mt(e){const u=[],t=e.indexOf(iu),r=e.indexOf(It);if(t===-1)return[{type:"text",content:e}];const n=e.substring(0,t).trim();n&&u.push({type:"text",content:n});const c=(r!==-1?e.substring(t+iu.length,r):e.substring(t+iu.length)).split(/(?=\\nContent from @)/);for(const s of c){const l=s.trim();if(!l)continue;const i=l.match(Bo);if(i){const d=i[1].trim(),f=d.split("/").pop()||d,b=l.substring(i[0].length);u.push({type:"file_reference",content:b.trim(),filePath:d,fileName:f})}else l&&!l.startsWith("Content from @")&&u.push({type:"file_reference",content:l})}if(r!==-1){const s=e.substring(r+It.length).trim();s&&u.push({type:"text",content:s})}return u}const $o=({segment:e,onFileClick:u,defaultExpanded:t=!1})=>{const[r,n]=ne(t),o=C.useMemo(()=>e.content.split(`\n`).length,[e.content]),c=()=>{n(!r)},s=()=>{e.filePath&&u&&u(e.filePath)};return a.jsxs("div",{className:"rounded-md overflow-hidden",style:{border:"1px solid var(--app-input-border)",backgroundColor:"var(--app-secondary-background)"},children:[a.jsxs("button",{type:"button",className:"flex items-center gap-1.5 w-full py-1.5 px-2.5 bg-transparent border-none cursor-pointer text-left text-xs transition-colors duration-150 hover:bg-black/5",style:{color:"var(--app-secondary-foreground)"},onClick:c,"aria-expanded":r,children:[a.jsx("span",{className:"text-[8px] flex-shrink-0 transition-transform duration-200",style:{color:"var(--app-secondary-foreground)",transform:r?"rotate(90deg)":"rotate(0deg)"},children:"\u25B6"}),a.jsx("span",{className:"text-sm flex-shrink-0",children:"\u{1F4C4}"}),a.jsx("span",{className:"font-medium cursor-pointer overflow-hidden text-ellipsis whitespace-nowrap flex-1 min-w-0 hover:underline",style:{color:"var(--app-link-color, #0066cc)"},onClick:l=>{l.stopPropagation(),s()},title:e.filePath,children:e.fileName||"Referenced file"}),a.jsxs("span",{className:"text-[11px] flex-shrink-0 ml-auto",style:{color:"var(--app-tertiary-foreground, #999)"},children:[o," ",o===1?"line":"lines"]})]}),r&&a.jsx("div",{className:"py-2 px-2.5 max-h-[300px] overflow-y-auto text-xs leading-normal",style:{borderTop:"1px solid var(--app-input-border)",backgroundColor:"var(--app-primary-background)"},children:a.jsx(ie,{content:e.content,onFileClick:u,enableFileLinks:!0})})]})},Lt=({content:e,onFileClick:u,enableFileLinks:t=!1})=>{const r=C.useMemo(()=>Mt(e),[e]);return r.length===1&&r[0].type==="text"?a.jsx(ie,{content:e,onFileClick:u,enableFileLinks:t}):a.jsx("div",{className:"flex flex-col gap-2",children:r.map((n,o)=>n.type==="text"?a.jsx("div",{children:a.jsx(ie,{content:n.content,onFileClick:u,enableFileLinks:t})},o):a.jsx($o,{segment:n,onFileClick:u,defaultExpanded:!1},o))})};/**\n * @license\n * Copyright 2025 Qwen Team\n * SPDX-License-Identifier: Apache-2.0\n *\n * Status and state related icons\n */const Oo=({size:e=14,className:u,...t})=>a.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 14 14",fill:"none",width:e,height:e,className:u,"aria-hidden":"true",...t,children:[a.jsx("circle",{cx:"7",cy:"7",r:"6",fill:"currentColor",opacity:"0.2"}),a.jsx("path",{d:"M4 7.5L6 9.5L10 4.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),zo=({size:e=14,className:u,...t})=>a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 14 14",fill:"none",width:e,height:e,className:u,"aria-hidden":"true",...t,children:a.jsx("circle",{cx:"7",cy:"7",r:"5",fill:"none",stroke:"currentColor",strokeWidth:"2.5"})}),jo=({size:e=14,className:u,...t})=>a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 14 14",fill:"none",width:e,height:e,className:u,"aria-hidden":"true",...t,children:a.jsx("circle",{cx:"7",cy:"7",r:"5.5",fill:"none",stroke:"currentColor",strokeWidth:"1"})}),qo=({size:e=20,className:u,...t})=>a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",width:e,height:e,className:u,"aria-hidden":"true",...t,children:a.jsx("path",{fillRule:"evenodd",d:"M8.485 2.495c.673-1.167 2.357-1.167 3.03 0l6.28 10.875c.673 1.167-.17 2.625-1.516 2.625H3.72c-1.347 0-2.189-1.458-1.515-2.625L8.485 2.495ZM10 5a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 10 5Zm0 9a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z",clipRule:"evenodd"})}),Ho=({size:e=16,className:u,...t})=>a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor",width:e,height:e,className:u,"aria-hidden":"true",...t,children:a.jsx("path",{d:"M8 8a3 3 0 1 0 0-6 3 3 0 0 0 0 6ZM12.735 14c.618 0 1.093-.561.872-1.139a6.002 6.002 0 0 0-11.215 0c-.22.578.254 1.139.872 1.139h9.47Z"})}),Zo=({size:e=16,className:u,...t})=>a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor",width:e,height:e,className:u,"aria-hidden":"true",...t,children:a.jsx("path",{d:"M8 1a.5.5 0 0 1 .5.5v5.793l2.146-2.147a.5.5 0 0 1 .708.708l-3 3a.5.5 0 0 1-.708 0l-3-3a.5.5 0 1 1 .708-.708L7.5 7.293V1.5A.5.5 0 0 1 8 1Z"})}),Vo=({size:e=16,className:u,...t})=>a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor",width:e,height:e,className:u,"aria-hidden":"true",...t,children:a.jsx("path",{d:"M2 3.5a.5.5 0 0 1 .5-.5h11a.5.5 0 0 1 0 1h-11a.5.5 0 0 1-.5-.5Zm0 4a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7a.5.5 0 0 1-.5-.5Zm0 4a.5.5 0 0 1 .5-.5h9a.5.5 0 0 1 0 1h-9a.5.5 0 0 1-.5-.5Z"})}),Uo=({size:e=16,className:u,...t})=>a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor",width:e,height:e,className:u,"aria-hidden":"true",...t,children:a.jsx("path",{fillRule:"evenodd",d:"M12.416 3.376a.75.75 0 0 1 .208 1.04l-5 7.5a.75.75 0 0 1-1.154.114l-3-3a.75.75 0 0 1 1.06-1.06l2.353 2.353 4.493-6.74a.75.75 0 0 1 1.04-.207Z",clipRule:"evenodd"})});function Pt(e){return typeof e!="number"||!Number.isFinite(e)||e<=0?null:new Date(e)}function Wo(e){const u=Pt(e);return u?u.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):null}function Go(e){const u=Pt(e);if(!u)return;const t=u.getHours().toString().padStart(2,"0"),r=u.getMinutes().toString().padStart(2,"0");return`${t}:${r}`}const Bt=({timestamp:e,copyText:u,onEdit:t,editDisabled:r=!1,editIcon:n})=>{var p;const o=re(),c=o.copyToClipboard,[s,l]=C.useState(!1),i=C.useRef(null),d=Wo(e),f=((p=o.features)==null?void 0:p.canCopy)!==!1&&u.length>0,b=Go(e);C.useEffect(()=>()=>{i.current!==null&&window.clearTimeout(i.current)},[]);const h=C.useCallback(async k=>{if(k.stopPropagation(),!!f)try{c?await c(u):await navigator.clipboard.writeText(u),l(!0),i.current!==null&&window.clearTimeout(i.current),i.current=window.setTimeout(()=>{l(!1),i.current=null},1400)}catch(y){console.error("Failed to copy message:",y)}},[f,u,c]);return!d&&!f&&!t?null:a.jsxs("div",{className:"mt-1 flex min-h-6 items-center gap-1 text-xs text-[var(--app-secondary-foreground)]",children:[d&&a.jsx("time",{className:"select-none opacity-60",dateTime:b,children:d}),a.jsxs("div",{className:`flex items-center gap-0.5 transition-opacity focus-within:opacity-100 ${s?"opacity-100":"opacity-0 group-hover:opacity-70"}`,children:[f&&a.jsx("button",{type:"button",className:`inline-flex h-6 w-6 items-center justify-center rounded-sm border border-transparent bg-transparent transition-colors hover:bg-[var(--app-ghost-button-hover-background)] hover:opacity-100 focus:opacity-100 ${s?"text-[#74c991] opacity-100":""}`,title:s?"Copied":"Copy message","aria-label":s?"Copied":"Copy message",onClick:h,children:s?a.jsx(Uo,{size:14}):a.jsx(Zr,{size:14})}),t&&a.jsx("button",{type:"button",className:"inline-flex h-6 w-6 items-center justify-center rounded-sm border border-transparent bg-transparent transition-colors hover:bg-[var(--app-ghost-button-hover-background)] hover:opacity-100 focus:opacity-100 disabled:cursor-not-allowed disabled:opacity-30",title:"Edit message","aria-label":"Edit message",onClick:t,disabled:r,children:n})]})]})},$t=({content:e,timestamp:u,onFileClick:t,fileContext:r,onEdit:n,editDisabled:o=!1})=>{const s=(()=>{if(!r)return null;const{fileName:l,startLine:i,endLine:d}=r;return i!=null?d!=null&&d!==i?`${l}#${i}-${d}`:`${l}#${i}`:l})();return a.jsxs("div",{className:"qwen-message user-message-container group flex gap-0 my-1 items-start text-left flex-col relative",style:{position:"relative"},children:[a.jsx("div",{className:"inline-block relative whitespace-pre-wrap rounded-md max-w-full overflow-x-auto overflow-y-hidden select-text leading-[1.5]",style:{border:"1px solid var(--app-input-border)",borderRadius:"var(--corner-radius-medium)",backgroundColor:"var(--app-input-background)",padding:"4px 6px",color:"var(--app-primary-foreground)"},children:a.jsx(Lt,{content:e,onFileClick:t,enableFileLinks:!1})}),a.jsx(Bt,{timestamp:u,copyText:e,onEdit:n,editDisabled:o,editIcon:a.jsx(Ve,{size:14})}),s&&a.jsx("div",{className:"mt-1",children:a.jsx("button",{type:"button",className:"inline-flex items-center py-0 pr-2 gap-1 rounded-sm cursor-pointer relative opacity-50 bg-transparent border-none",onClick:()=>r&&(t==null?void 0:t(r.filePath)),disabled:!t,children:a.jsx("span",{title:s,style:{fontSize:"12px",color:"var(--app-secondary-foreground)"},children:s})})})]})};$t.displayName="UserMessage";const Ot=C.memo($t);/**\n * @license\n * Copyright 2025 Qwen Team\n * SPDX-License-Identifier: Apache-2.0\n *\n * File and document related icons\n */const Xo=({size:e=16,className:u,...t})=>a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor",width:e,height:e,className:u,"aria-hidden":"true",...t,children:a.jsx("path",{d:"M9 2H4a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V7l-5-5zm3 7V3.5L10.5 2H10v3a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1V2H4a1 1 0 0 0-1 1v8a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1zM6 3h3v2H6V3z"})}),Jo=({size:e=16,className:u,...t})=>a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor",width:e,height:e,className:u,"aria-hidden":"true",...t,children:a.jsx("path",{d:"M5 3.5a.5.5 0 0 1 .5-.5h4a.5.5 0 0 1 0 1h-4a.5.5 0 0 1-.5-.5Zm0 2a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7a.5.5 0 0 1-.5-.5Zm0 2a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7a.5.5 0 0 1-.5-.5Zm0 2a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7a.5.5 0 0 1-.5-.5Z"})}),Qo=({size:e=16,className:u,...t})=>a.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",width:e,height:e,className:u,"aria-hidden":"true",...t,children:[a.jsx("path",{d:"M2.66663 2.66663H10.6666L13.3333 5.33329V13.3333H2.66663V2.66663Z"}),a.jsx("path",{d:"M8 10.6666V8M8 8V5.33329M8 8H10.6666M8 8H5.33329"})]}),Ko=({size:e=16,className:u,...t})=>a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor",width:e,height:e,className:u,"aria-hidden":"true",...t,children:a.jsx("path",{d:"M1.5 3A1.5 1.5 0 0 1 3 1.5h3.086a1.5 1.5 0 0 1 1.06.44L8.5 3H13A1.5 1.5 0 0 1 14.5 4.5v7A1.5 1.5 0 0 1 13 13H3A1.5 1.5 0 0 1 1.5 11.5v-8Z"})});/**\n * @license\n * Copyright 2025 Qwen Team\n * SPDX-License-Identifier: Apache-2.0\n *\n * Special UI icons\n */const Yo=({size:e=16,className:u,enabled:t=!1,style:r,...n})=>a.jsx("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:u,"aria-hidden":"true",...n,children:a.jsx("path",{d:"M8.00293 1.11523L8.35059 1.12402H8.35352C11.9915 1.30834 14.8848 4.31624 14.8848 8C14.8848 11.8025 11.8025 14.8848 8 14.8848C4.19752 14.8848 1.11523 11.8025 1.11523 8C1.11523 7.67691 1.37711 7.41504 1.7002 7.41504C2.02319 7.41514 2.28516 7.67698 2.28516 8C2.28516 11.1563 4.84369 13.7148 8 13.7148C11.1563 13.7148 13.7148 11.1563 13.7148 8C13.7148 4.94263 11.3141 2.4464 8.29492 2.29297V2.29199L7.99609 2.28516H7.9873V2.28418L7.89648 2.27539L7.88281 2.27441V2.27344C7.61596 2.21897 7.41513 1.98293 7.41504 1.7002C7.41504 1.37711 7.67691 1.11523 8 1.11523H8.00293ZM8 3.81543C8.32309 3.81543 8.58496 4.0773 8.58496 4.40039V7.6377L10.9619 8.82715C11.2505 8.97169 11.3678 9.32256 11.2236 9.61133C11.0972 9.86425 10.8117 9.98544 10.5488 9.91504L10.5352 9.91211V9.91016L10.4502 9.87891L10.4385 9.87402V9.87305L7.73828 8.52344C7.54007 8.42433 7.41504 8.22155 7.41504 8V4.40039C7.41504 4.0773 7.67691 3.81543 8 3.81543ZM2.44336 5.12695C2.77573 5.19517 3.02597 5.48929 3.02637 5.8418C3.02637 6.19456 2.7761 6.49022 2.44336 6.55859L2.2959 6.57324C1.89241 6.57324 1.56543 6.24529 1.56543 5.8418C1.56588 5.43853 1.89284 5.1123 2.2959 5.1123L2.44336 5.12695ZM3.46094 2.72949C3.86418 2.72984 4.19017 3.05712 4.19043 3.45996V3.46094C4.19009 3.86393 3.86392 4.19008 3.46094 4.19043H3.45996C3.05712 4.19017 2.72983 3.86419 2.72949 3.46094V3.45996C2.72976 3.05686 3.05686 2.72976 3.45996 2.72949H3.46094ZM5.98926 1.58008C6.32235 1.64818 6.57324 1.94276 6.57324 2.2959L6.55859 2.44336C6.49022 2.7761 6.19456 3.02637 5.8418 3.02637C5.43884 3.02591 5.11251 2.69895 5.1123 2.2959L5.12695 2.14844C5.19504 1.81591 5.48906 1.56583 5.8418 1.56543L5.98926 1.58008Z",strokeWidth:"0.27",style:{stroke:t?"var(--app-qwen-ivory)":"var(--app-secondary-foreground)",fill:t?"var(--app-qwen-ivory)":"var(--app-secondary-foreground)",...r}})}),Ro=({size:e=20,className:u,...t})=>a.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",width:e,height:e,className:u,"aria-hidden":"true",...t,children:[a.jsx("path",{fillRule:"evenodd",d:"M5.14648 7.14648C5.34175 6.95122 5.65825 6.95122 5.85352 7.14648L8.35352 9.64648C8.44728 9.74025 8.5 9.86739 8.5 10C8.5 10.0994 8.47037 10.1958 8.41602 10.2773L8.35352 10.3535L5.85352 12.8535C5.65825 13.0488 5.34175 13.0488 5.14648 12.8535C4.95122 12.6583 4.95122 12.3417 5.14648 12.1465L7.29297 10L5.14648 7.85352C4.95122 7.65825 4.95122 7.34175 5.14648 7.14648Z",clipRule:"evenodd"}),a.jsx("path",{d:"M14.5 12C14.7761 12 15 12.2239 15 12.5C15 12.7761 14.7761 13 14.5 13H9.5C9.22386 13 9 12.7761 9 12.5C9 12.2239 9.22386 12 9.5 12H14.5Z"}),a.jsx("path",{fillRule:"evenodd",d:"M16.5 4C17.3284 4 18 4.67157 18 5.5V14.5C18 15.3284 17.3284 16 16.5 16H3.5C2.67157 16 2 15.3284 2 14.5V5.5C2 4.67157 2.67157 4 3.5 4H16.5ZM3.5 5C3.22386 5 3 5.22386 3 5.5V14.5C3 14.7761 3.22386 15 3.5 15H16.5C16.7761 15 17 14.7761 17 14.5V5.5C17 5.22386 16.7761 5 16.5 5H3.5Z",clipRule:"evenodd"})]}),zt=({content:e,timestamp:u,onFileClick:t,defaultExpanded:r=!1,status:n="default"})=>{const[o,c]=ne(r),s=()=>{c(!o)};return a.jsx("div",{className:`qwen-message message-item thinking-message thinking-status-${n}`,children:a.jsxs("div",{className:"thinking-content-wrapper",children:[a.jsxs("button",{type:"button",onClick:s,className:"thinking-toggle-btn","aria-expanded":o,"aria-label":o?"Collapse thinking":"Expand thinking",children:[a.jsx("span",{className:"thinking-label",children:"Thinking"}),a.jsx(Mr,{size:12,direction:o?"up":"down",className:"thinking-chevron"})]}),o&&a.jsx("div",{className:"thinking-content",children:a.jsx(ie,{content:e,onFileClick:t})})]})})};zt.displayName="ThinkingMessage";const jt=C.memo(zt),qt=({content:e,timestamp:u,onFileClick:t,status:r="default",hideStatusIcon:n=!1,isFirst:o=!1,isLast:c=!1})=>{if(!e||e.trim().length===0)return null;const s=()=>{if(n)return"";switch(r){case"success":return"assistant-message-success";case"error":return"assistant-message-error";case"warning":return"assistant-message-warning";case"loading":return"assistant-message-loading";default:return"assistant-message-default"}};return a.jsx("div",{className:`qwen-message message-item assistant-message-container group ${s()}`,"data-first":o,"data-last":c,style:{width:"100%",alignItems:"flex-start",paddingLeft:"30px",userSelect:"text",position:"relative"},children:a.jsxs("span",{style:{width:"100%"},children:[a.jsx("div",{style:{margin:0,width:"100%",wordWrap:"break-word",overflowWrap:"break-word",whiteSpace:"normal"},children:a.jsx(ie,{content:e,onFileClick:t,enableFileLinks:!1})}),a.jsx(Bt,{timestamp:u,copyText:e})]})})};qt.displayName="AssistantMessage";const Ht=C.memo(qt);/**\n * @license\n * Copyright 2025 Qwen Team\n * SPDX-License-Identifier: Apache-2.0\n */const ea=e=>Math.max(0,Math.min(100,Math.round(e))),ua=({stage:e,progress:u,detail:t})=>{const r=ea(u);return a.jsx("div",{className:"w-full px-[30px] py-2",children:a.jsxs("div",{className:"grid grid-cols-[minmax(0,1fr)_auto] items-center gap-x-4 gap-y-1",children:[a.jsx("div",{className:"min-w-0 truncate text-sm leading-6 text-[var(--vscode-foreground)]",children:e}),a.jsxs("div",{className:"row-span-2 shrink-0 self-center text-xs leading-none tabular-nums text-[var(--vscode-descriptionForeground)]",children:[r,"%"]}),t?a.jsx("div",{className:"min-w-0 truncate text-xs leading-5 text-[var(--vscode-descriptionForeground)]",children:t}):a.jsx("div",{className:"text-xs leading-5 text-[var(--vscode-descriptionForeground)]",children:"Processing your chat history\u2026"})]})})},ta=({questions:e,onSubmit:u,onCancel:t})=>{const[r,n]=C.useState(0),[o,c]=C.useState({}),[s,l]=C.useState(!1),i=C.useRef(null),d=C.useRef(null),f=e.length>1,b=f?e.length+1:e.length,h=f&&r===b-1,p=h?null:e[r],k=(p==null?void 0:p.multiSelect)??!1,y=o[r]||{},D=C.useCallback(E=>{const A=e[E],S=o[E];if(S){if(A!=null&&A.multiSelect){const T=[...S.multiSelectedOptions||[]],L=(S.customInput||"").trim();return S.customInputChecked&&L&&T.push(L),T.length>0?T.join(", "):void 0}return S.customInput&&S.customInput.trim()&&!(A==null?void 0:A.options.some(L=>{var I;return L.label===((I=S.customInput)==null?void 0:I.trim())}))?S.customInput.trim():S.selectedOption}},[e,o]),x=C.useCallback(()=>{const E={};e.forEach((A,S)=>{const T=D(S);T!==void 0&&(E[S]=T)}),u(E)},[e,u,D]),m=C.useCallback(()=>{if(!p)return;const E=o[r]||{},A=[...E.multiSelectedOptions||[]],S=(E.customInput||"").trim();if(E.customInputChecked&&S&&A.push(S),A.length===0)return;const T=A.join(", "),L={...o,[r]:{...E,selectedOption:T}};c(L),f?r<b-1&&(n(r+1),l(!1)):u({[r]:T})},[p,o,r,f,b,u]),_=C.useCallback(E=>{if(p)if(k){const A=o[r]||{},S=A.multiSelectedOptions||[],T=p.options[E],I=S.includes(T.label)?S.filter(z=>z!==T.label):[...S,T.label];c({...o,[r]:{...A,multiSelectedOptions:I}})}else{const A=p.options[E],T={...o[r]||{},selectedOption:A.label,customInput:void 0};c({...o,[r]:T}),f?r<b-1&&(n(r+1),l(!1)):u({[r]:A.label})}},[p,k,o,r,f,b,u]),v=E=>{const A=o[r]||{};c({...o,[r]:{...A,customInput:E,customInputChecked:k&&E.trim().length>0}})},w=()=>{var A;const E=((A=y.customInput)==null?void 0:A.trim())||"";if(E)if(k){const S=o[r]||{};c({...o,[r]:{...S,customInputChecked:!S.customInputChecked}})}else{const T={...o[r]||{},selectedOption:E};c({...o,[r]:T}),f?r<b-1&&(n(r+1),l(!1)):u({[r]:E})}};C.useEffect(()=>{const E=A=>{A.key==="Escape"&&(A.preventDefault(),t())};return window.addEventListener("keydown",E),()=>window.removeEventListener("keydown",E)},[t]),C.useEffect(()=>{s&&d.current&&d.current.focus()},[s]),C.useEffect(()=>{l(!1)},[r]);const N=()=>a.jsxs("div",{className:"flex gap-2 mb-4 overflow-x-auto",children:[e.map((E,A)=>{const S=D(A)!==void 0,T=A===r;return a.jsxs("button",{className:`flex items-center gap-1.5 px-3 py-1.5 rounded-full text-sm whitespace-nowrap cursor-pointer transition-colors border-none ${T?"bg-[var(--app-button-background)] text-[var(--app-button-foreground)] font-bold":"bg-[var(--app-button-secondary-background)] text-[var(--app-secondary-foreground)] hover:opacity-80"}`,onClick:()=>n(A),children:[a.jsx("span",{children:E.header}),S&&a.jsx("span",{className:"text-green-500",children:"\u2713"})]},A)}),a.jsx("button",{className:`flex items-center gap-1.5 px-3 py-1.5 rounded-full text-sm whitespace-nowrap cursor-pointer transition-colors border-none ${h?"bg-[var(--app-button-background)] text-[var(--app-button-foreground)] font-bold":"bg-[var(--app-button-secondary-background)] text-[var(--app-secondary-foreground)] opacity-60 hover:opacity-80"}`,onClick:()=>n(b-1),children:a.jsx("span",{children:"Submit"})})]}),F={backgroundColor:"var(--app-input-secondary-background)",borderColor:"var(--app-input-border)",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)"};return h?a.jsxs("div",{ref:i,className:"fixed inset-x-4 bottom-4 z-[1000] rounded-lg border p-4 outline-none animate-slide-up",style:F,children:[N(),a.jsxs("div",{className:"mb-4",children:[a.jsx("div",{className:"font-bold text-[var(--app-primary-foreground)] mb-2",children:"Your answers:"}),e.map((E,A)=>{const S=D(A);return a.jsxs("div",{className:"ml-2 mb-1 text-[var(--app-secondary-foreground)]",children:[a.jsxs("span",{className:"font-semibold",children:[E.header,":"]})," ",S?a.jsx("span",{style:{color:"var(--app-link-color)"},children:S}):a.jsx("span",{className:"opacity-60",children:"(not answered)"})]},A)})]}),a.jsxs("div",{className:"flex gap-2 mt-4",children:[a.jsx("button",{className:"px-4 py-2 rounded-md font-medium transition-colors cursor-pointer border-none",style:{backgroundColor:"var(--app-button-background)",color:"var(--app-button-foreground)"},onClick:x,children:"Submit"}),a.jsx("button",{className:"px-4 py-2 rounded-md font-medium transition-colors cursor-pointer border-none hover:opacity-80",style:{backgroundColor:"var(--app-button-secondary-background)",color:"var(--app-primary-foreground)"},onClick:t,children:"Cancel"})]})]}):a.jsxs("div",{ref:i,className:"fixed inset-x-4 bottom-4 z-[1000] rounded-lg border p-4 outline-none animate-slide-up",style:F,children:[f&&N(),a.jsxs("div",{className:"mb-4",children:[!f&&a.jsx("div",{className:"mb-2",children:a.jsx("span",{className:"font-bold text-lg",style:{color:"var(--app-link-color)"},children:p.header})}),a.jsx("div",{className:"text-[var(--app-primary-foreground)] text-base",children:p.question})]}),a.jsxs("div",{className:"flex flex-col gap-2 mb-3",children:[p.options.map((E,A)=>{var L;const S=!k&&y.selectedOption===E.label,T=k&&((L=y.multiSelectedOptions)==null?void 0:L.includes(E.label));return a.jsxs("div",{className:"flex flex-col",children:[a.jsxs("button",{className:`flex items-center gap-2 px-3 py-2 text-left w-full rounded-md border transition-colors duration-150 cursor-pointer ${S||T?"bg-[var(--app-list-active-background)] text-[var(--app-list-active-foreground)]":"bg-[var(--app-button-secondary-background)] text-[var(--app-primary-foreground)] hover:bg-[var(--app-list-active-background)] hover:text-[var(--app-list-active-foreground)]"}`,onClick:()=>_(A),children:[k?a.jsx("span",{className:"min-w-[18px]",children:T?"\u2611":"\u2610"}):a.jsx("span",{className:"min-w-[18px]",children:S?"\u25CF":"\u25CB"}),a.jsx("span",{className:"flex-1",children:E.label})]}),E.description&&a.jsx("div",{className:"ml-8 mt-1 text-sm opacity-70",style:{color:"var(--app-secondary-foreground)"},children:E.description})]},A)}),a.jsx("div",{className:"flex flex-col",children:s?a.jsxs("div",{className:"flex items-center gap-2",children:[k&&a.jsx("span",{className:"min-w-[18px] cursor-pointer",onClick:()=>{const E=o[r]||{};c({...o,[r]:{...E,customInputChecked:!E.customInputChecked}})},children:y.customInputChecked?"\u2611":"\u2610"}),a.jsx("input",{ref:d,type:"text",className:"flex-1 px-3 py-2 rounded-md border focus:outline-none focus:ring-1",style:{backgroundColor:"var(--app-input-background)",borderColor:"var(--app-input-border)",color:"var(--app-primary-foreground)"},value:y.customInput||"",onChange:E=>v(E.target.value),onKeyDown:E=>{E.key==="Enter"&&(E.preventDefault(),E.stopPropagation(),w())},placeholder:"Type your answer..."})]}):a.jsxs("button",{className:`flex items-center gap-2 px-3 py-2 text-left w-full rounded-md border transition-colors duration-150 cursor-pointer\n bg-[var(--app-button-secondary-background)] text-[var(--app-secondary-foreground)] hover:bg-[var(--app-list-active-background)] hover:text-[var(--app-list-active-foreground)]`,onClick:()=>l(!0),children:[a.jsx("span",{className:"min-w-[18px]",children:"\u270E"}),a.jsx("span",{className:"flex-1 opacity-70",children:y.customInput||"Other..."})]})})]}),a.jsxs("div",{className:"flex gap-2 mt-3",children:[k&&a.jsx("button",{className:"px-4 py-2 rounded-md font-medium transition-colors cursor-pointer border-none",style:{backgroundColor:"var(--app-button-background)",color:"var(--app-button-foreground)"},onClick:m,children:"Confirm"}),a.jsx("button",{className:"px-4 py-2 rounded-md font-medium transition-colors cursor-pointer border-none hover:opacity-80",style:{backgroundColor:"var(--app-button-secondary-background)",color:"var(--app-primary-foreground)"},onClick:t,children:"Cancel"})]})]})},ra=({images:e,onRemove:u})=>e.length===0?null:a.jsx("div",{className:"image-preview-container flex gap-2 px-2 pb-2",children:e.map(t=>a.jsx("div",{className:"image-preview-item relative group",children:a.jsxs("div",{className:"relative",children:[a.jsx("img",{src:t.data,alt:t.name,className:"w-14 h-14 object-cover rounded-md border border-gray-500 dark:border-gray-600",title:t.name}),a.jsx("button",{type:"button",onClick:()=>u(t.id),className:"absolute -top-2 -right-2 w-5 h-5 bg-gray-700 dark:bg-gray-600 text-white rounded-full flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity hover:bg-gray-800 dark:hover:bg-gray-500","aria-label":`Remove ${t.name}`,children:a.jsx(Cu,{})})]})},t.id))}),na=({msg:e,imageIndex:u})=>{if(e.kind!=="image"||!e.imagePath)return null;const t=`[Image #${u}]`,r=!!e.imageSrc&&!e.imageMissing;return a.jsx("div",{className:"qwen-message user-message-container flex gap-0 my-1 items-start text-left flex-col relative",children:a.jsxs("div",{className:"inline-block relative whitespace-pre-wrap rounded-md max-w-full overflow-x-auto overflow-y-hidden select-text leading-[1.5]",style:{border:"1px solid var(--app-input-border)",borderRadius:"var(--corner-radius-medium)",backgroundColor:"var(--app-input-background)",padding:"6px 8px",color:"var(--app-primary-foreground)"},children:[a.jsx("div",{style:{fontSize:"12px",color:"var(--app-secondary-foreground)",marginBottom:"4px"},children:t}),r?a.jsx("img",{src:e.imageSrc,alt:e.imagePath,className:"max-w-full rounded-md border border-gray-600"}):a.jsxs("div",{style:{fontSize:"12px",color:"var(--app-secondary-foreground)"},children:["@",e.imagePath]})]})})},O=({label:e,status:u="success",children:t,toolCallId:r,labelSuffix:n,className:o,isFirst:c=!1,isLast:s=!1})=>a.jsx("div",{className:`qwen-message message-item ${o||""} relative pl-[30px] py-2 select-text toolcall-container toolcall-status-${u}`,"data-first":c,"data-last":s,children:a.jsxs("div",{className:"toolcall-content-wrapper flex flex-col min-w-0 max-w-full",children:[a.jsxs("div",{className:"flex items-baseline gap-1.5 relative min-w-0",children:[a.jsx("span",{className:"text-[14px] leading-none font-bold text-[var(--app-primary-foreground)]",children:e}),a.jsx("span",{className:"text-[11px] text-[var(--app-secondary-foreground)]",children:n})]}),t&&a.jsx("div",{className:"text-[var(--app-secondary-foreground)]",children:t})]})}),Ce=({icon:e,children:u})=>a.jsx("div",{className:"grid grid-cols-[auto_1fr] gap-medium bg-[var(--app-input-background)] border border-[var(--app-input-border)] rounded-medium p-large my-medium items-start animate-[fadeIn_0.2s_ease-in] toolcall-card",children:a.jsx("div",{className:"flex flex-col gap-medium min-w-0",children:u})}),W=({label:e,children:u})=>a.jsxs("div",{className:"grid grid-cols-[80px_1fr] gap-medium min-w-0",children:[a.jsx("div",{className:"text-xs text-[var(--app-secondary-foreground)] font-medium pt-[2px]",children:e}),a.jsx("div",{className:"text-[var(--app-primary-foreground)] min-w-0 break-words",children:u})]}),oa=e=>{switch(e){case"pending":return"bg-[#ffc107]";case"in_progress":return"bg-[#2196f3]";case"completed":return"bg-[#4caf50]";case"failed":return"bg-[#f44336]";default:return"bg-gray-500"}},aa=({status:e,text:u})=>a.jsxs("div",{className:"inline-block font-medium relative",title:e,children:[a.jsx("span",{className:`inline-block w-1.5 h-1.5 rounded-full mr-1.5 align-middle ${oa(e)}`}),u]}),ca=({children:e})=>a.jsx("pre",{className:"font-mono text-[var(--app-monospace-font-size)] bg-[var(--app-primary-background)] border border-[var(--app-input-border)] rounded-small p-medium overflow-x-auto mt-1 whitespace-pre-wrap break-words max-h-[300px] overflow-y-auto",children:e}),Zt=({locations:e})=>a.jsx("div",{className:"toolcall-locations-list flex flex-col gap-1 max-w-full",children:e.map((u,t)=>a.jsx(j,{path:u.path,line:u.line,showFullPath:!0},t))}),du=({children:e,isCollapsible:u,collapsedHeight:t=200,fadeStart:r=140,className:n=""})=>{const[o,c]=ne(!1);return a.jsxs("div",{className:"flex flex-col gap-[3px]",children:[a.jsx("div",{className:`toolcall-collapsible-output-content overflow-hidden ${n}`,style:!o&&u?{maxHeight:`${t}px`,maskImage:`linear-gradient(to bottom, var(--app-primary-background) ${r}px, transparent ${t}px)`,WebkitMaskImage:`linear-gradient(to bottom, var(--app-primary-background) ${r}px, transparent ${t}px)`}:void 0,children:e}),u&&a.jsx("div",{className:"flex justify-center border-t border-[var(--app-input-border)] pt-1",children:a.jsx("button",{type:"button",onClick:s=>{s.stopPropagation(),c(l=>!l)},"aria-expanded":o,"aria-label":o?"Collapse output":"Expand output",className:"text-[var(--app-secondary-foreground)] text-[0.8em] hover:text-[var(--app-primary-foreground)] cursor-pointer bg-transparent border-none px-2 py-1 rounded hover:bg-[var(--app-input-background)] transition-colors",children:o?"\u25B2 Collapse":"\u25BC Show more"})})]})},Vt=async(e,u,t)=>{u.stopPropagation();try{t?await t(e):await navigator.clipboard.writeText(e)}catch(r){console.error("Failed to copy text:",r)}},fu=({text:e})=>{var c;const[u,t]=C.useState(!1),r=re(),n=C.useCallback(async s=>{await Vt(e,s,r.copyToClipboard),t(!0),setTimeout(()=>t(!1),1e3)},[e,r.copyToClipboard]);return((c=r.features)==null?void 0:c.canCopy)!==!1?a.jsxs("button",{className:"col-start-3 bg-transparent border-none px-2 py-1.5 cursor-pointer text-[var(--app-secondary-foreground)] opacity-0 transition-opacity duration-200 ease-out flex items-center justify-center rounded relative group-hover:opacity-70 hover:!opacity-100 hover:bg-[var(--app-input-border)] active:scale-95",onClick:n,title:"Copy","aria-label":"Copy to clipboard",type:"button",children:[a.jsx("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:a.jsx("path",{d:"M4 4V3C4 2.44772 4.44772 2 5 2H13C13.5523 2 14 2.44772 14 3V11C14 11.5523 13.5523 12 13 12H12M3 6H11C11.5523 6 12 6.44772 12 7V13C12 13.5523 11.5523 14 11 14H3C2.44772 14 2 13.5523 2 13V7C2 6.44772 2.44772 6 3 6Z",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),u&&a.jsx("span",{className:"absolute -top-7 right-0 bg-[var(--app-tool-background)] text-[var(--app-primary-foreground)] px-2 py-1 rounded text-xs whitespace-nowrap border border-[var(--app-input-border)] pointer-events-none",children:"Copied!"})]}):null};/**\n * @license\n * Copyright 2025 Qwen Team\n * SPDX-License-Identifier: Apache-2.0\n *\n * Shared utility functions for tool call components\n * Platform-agnostic utilities that can be used across different platforms\n */const Ut=e=>{try{const t=JSON.parse(e),r=t.output??t.Output;if(r!=null)return typeof r=="string"?r:JSON.stringify(r,null,2)}catch{}const u=e.match(/Output:[ \\t]{0,20}(.{0,1000}?)(?=\\nError:|$)/i);if(u&&u[1]){const t=u[1].trim();if(t&&t!=="(none)"&&t.length>0)return t}if(e.match(/^Command:/)){const t=e.split(`\n`),r=[];let n=!1;for(const o of t){if(o.startsWith("Error:")||o.startsWith("Exit Code:")||o.startsWith("Signal:")||o.startsWith("Background PIDs:")||o.startsWith("Process Group PGID:"))break;if(!(o.startsWith("Command:")||o.startsWith("Directory:"))){if(o.startsWith("Output:")){n=!0;const c=o.substring(7).trim();c&&c!=="(none)"&&r.push(c);continue}(n||!o.startsWith("Command:")&&!o.startsWith("Directory:"))&&r.push(o)}}if(r.length>0){const o=r.join(`\n`).trim();if(o&&o!=="(none)")return o}}return e},je=e=>{if(e==null)return"";if(typeof e=="string")return Ut(e);if(e instanceof Error)return e.message||e.toString();if(typeof e=="object"&&e!==null&&"message"in e)return e.message||String(e);if(typeof e=="object")try{return JSON.stringify(e,null,2)}catch{return String(e)}return String(e)},te=e=>{if(typeof e=="string"&&e.trim())return e;if(e&&typeof e=="object")try{return JSON.stringify(e)}catch{return String(e)}return""},Wt=e=>!e.includes("internal"),G=e=>{const u=[],t=[],r=[],n=[];return e==null||e.forEach(o=>{if(o.type==="diff")r.push(o);else if(o.content){const c=o.content,s=c.error!=null,l=c.type==="error"&&(c.text!=null||c.error!=null);if(s||l){let d="";typeof c.error=="string"?d=c.error:c.error&&typeof c.error=="object"&&"message"in c.error?d=c.error.message:c.text?d=je(c.text):c.error?d=je(c.error):d="An error occurred",t.push(d)}else c.text?u.push(je(c.text)):n.push(c)}}),{textOutputs:u,errors:t,diffs:r,otherData:n}},sa=e=>{if(e.status==="failed")return!0;const u=e.kind.toLowerCase();if((u==="execute"||u==="bash"||u==="command")&&e.title&&typeof e.title=="string"&&e.title.trim()||e.locations&&e.locations.length>0)return!0;if(e.content&&e.content.length>0){const t=G(e.content);if(t.textOutputs.length>0||t.errors.length>0||t.diffs.length>0||t.otherData.length>0)return!0}return!!(e.title&&typeof e.title=="string"&&e.title.trim())},Z=e=>{switch(e){case"pending":case"in_progress":return"loading";case"failed":return"error";case"cancelled":return"warning";case"completed":return"success";default:return"default"}},Gt=({toolCall:e,isFirst:u,isLast:t})=>{const{content:r}=e,{textOutputs:n,errors:o}=G(r);if(o.length>0)return a.jsx(O,{label:"Think",status:"error",isFirst:u,isLast:t,children:o.join(`\n`)});if(n.length>0){const c=n.join(`\n\n`);if(c.length>200){const i=c.length>500;return a.jsx(Ce,{icon:"\u{1F4AD}",children:a.jsx(W,{label:"Think",children:i?a.jsx(du,{isCollapsible:!0,className:"italic opacity-90 leading-relaxed",children:c}):a.jsx("div",{className:"italic opacity-90 leading-relaxed",children:c})})})}const l=e.status==="pending"||e.status==="in_progress"?"loading":e.status==="failed"?"error":e.status==="cancelled"?"warning":"default";return a.jsx(O,{label:"Think",status:l,isFirst:u,isLast:t,children:a.jsx("span",{className:"italic opacity-90",children:c})})}return null};/**\n * @license\n * Copyright 2025 Qwen Team\n * SPDX-License-Identifier: Apache-2.0\n */const Xt=e=>typeof e=="string"?e.trim().toLowerCase():"",qe=(e,u)=>u.some(t=>e.startsWith(t)),la=e=>{const u=Xt(e);return qe(u,["readmanyfiles","read many files"])?"ReadManyFiles":qe(u,["listfiles","list files","list directory"])?"ListFiles":qe(u,["readfile","read file"])?"ReadFile":qe(u,["skill"])?"Skill":null},de=({kind:e,title:u})=>{switch(Xt(e)){case"execute":case"bash":case"command":case"shell":case"run_shell_command":return"Shell";case"todo_write":case"todowrite":case"update_todos":case"updated_plan":case"updatedplan":return"TodoList";case"web_fetch":case"webfetch":case"fetch":return"WebFetch";case"grep":case"grep_search":return"Grep";case"glob":return"Glob";case"search":case"find":return"Search";case"write":case"write_file":case"writefile":return"WriteFile";case"read_many_files":case"readmanyfiles":return"ReadManyFiles";case"list_directory":case"listfiles":case"ls":return"ListFiles";case"read_file":case"readfile":return"ReadFile";case"save_memory":case"savememory":case"memory":return"SaveMemory";case"enter_plan_mode":return"EnterPlanMode";case"exit_plan_mode":case"switch_mode":{const r=typeof u=="string"?u.toLowerCase():"";return r.includes("enterplanmode")||r.includes("enter plan")?"EnterPlanMode":"ExitPlanMode"}case"task":return"Task";case"skill":return"Skill";case"think":case"thinking":return"Think";case"read":return la(u)??"Read";default:return e}},ia=400,Jt=({toolCall:e,isFirst:u,isLast:t})=>{const{kind:r,title:n,content:o,locations:c,toolCallId:s}=e,l=te(n),i=de({kind:r,title:n}),{textOutputs:d,errors:f}=G(o);if(f.length>0)return a.jsxs(Ce,{icon:"\u{1F527}",children:[a.jsx(W,{label:i,children:a.jsx("div",{children:l})}),a.jsx(W,{label:"Error",children:a.jsx("div",{className:"text-[#c74e39] font-medium",children:f.join(`\n`)})})]});if(d.length>0){const b=d.join(`\n`);if(b.length>150)return a.jsxs(Ce,{icon:"\u{1F527}",children:[a.jsx(W,{label:i,children:a.jsx("div",{children:l})}),a.jsx(W,{label:"Output",children:a.jsx(du,{isCollapsible:b.length>ia,className:"text-[13px] opacity-90",children:a.jsx(_e,{content:b,enableFileLinks:!1})})})]});const p=Z(e.status);return a.jsx(O,{label:i,status:p,toolCallId:s,isFirst:u,isLast:t,children:l||b})}if(c&&c.length>0){const b=Z(e.status);return a.jsx(O,{label:i,status:b,toolCallId:s,isFirst:u,isLast:t,children:a.jsx(Zt,{locations:c})})}if(l){const b=Z(e.status);return a.jsx(O,{label:i,status:b,toolCallId:s,isFirst:u,isLast:t,children:l})}return null},Qt=e=>!!(e&&typeof e=="object"&&"type"in e&&e.type==="task_execution"&&"taskDescription"in e&&"status"in e),pu=e=>Qt(e.rawOutput),da={running:"Running",completed:"Completed",failed:"Failed",cancelled:"Cancelled"},fa={executing:"Running",awaiting_approval:"Awaiting approval",success:"Completed",failed:"Failed"},pa=e=>{if(e<1e3)return`${e}ms`;if(e<6e4)return`${(e/1e3).toFixed(e%1e3===0?0:1)}s`;const u=Math.floor(e/6e4),t=Math.round(e%6e4/1e3);return`${u}m ${t}s`},ha=(e,u)=>e.taskDescription||te(u)||"Agent Task",Kt=({toolCall:e})=>{var n,o;if(!pu(e))return null;const u=e.rawOutput,t=((n=u.toolCalls)==null?void 0:n.slice(-5))??[],r=Math.max(0,(((o=u.toolCalls)==null?void 0:o.length)??0)-t.length);return a.jsxs(Ce,{icon:"\u{1F916}",children:[a.jsx(W,{label:"Agent",children:a.jsx("div",{className:"font-medium text-[var(--app-primary-foreground)]",children:ha(u,e.title)})}),a.jsx(W,{label:"Status",children:a.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[a.jsx("span",{className:"font-medium",children:u.subagentName}),a.jsx("span",{className:"text-[var(--app-secondary-foreground)]",children:da[u.status]})]})}),t.length>0&&a.jsx(W,{label:u.status==="running"?"Progress":"Tools",children:a.jsxs("div",{className:"flex flex-col gap-1",children:[t.map(c=>a.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[a.jsx("span",{className:"font-mono text-[12px] text-[var(--app-primary-foreground)]",children:c.name}),a.jsx("span",{className:"text-[var(--app-secondary-foreground)]",children:fa[c.status]}),c.description&&a.jsx("span",{className:"text-[var(--app-secondary-foreground)]",children:c.description}),c.error&&a.jsx("span",{className:"text-[#c74e39]",children:c.error})]},c.callId)),r>0&&a.jsxs("div",{className:"text-[var(--app-secondary-foreground)]",children:["+",r," more tool calls"]})]})}),u.executionSummary&&a.jsx(W,{label:"Summary",children:a.jsxs("div",{className:"flex flex-wrap gap-x-4 gap-y-1",children:[a.jsxs("span",{children:[u.executionSummary.totalToolCalls," tool calls"]}),a.jsxs("span",{children:[(u.executionSummary.outputTokens??u.executionSummary.totalTokens).toLocaleString()," ","tokens"]}),a.jsx("span",{children:pa(u.executionSummary.totalDurationMs)})]})}),(u.status==="failed"||u.status==="cancelled")&&u.terminateReason&&a.jsx(W,{label:"Reason",children:a.jsx("div",{className:"text-[#c74e39] font-medium",children:u.terminateReason})})]})},Yt=({label:e,status:u="success",children:t,toolCallId:r,labelSuffix:n,className:o,isFirst:c=!1,isLast:s=!1})=>a.jsx("div",{className:`qwen-message message-item ${o||""} relative pl-[30px] py-2 select-text toolcall-container toolcall-status-${u}`,"data-first":c,"data-last":s,children:a.jsxs("div",{className:"EditToolCall toolcall-content-wrapper flex flex-col gap-1 min-w-0 max-w-full",children:[a.jsxs("div",{className:"flex items-baseline gap-1.5 relative min-w-0",children:[a.jsx("span",{className:"text-[14px] leading-none font-bold text-[var(--app-primary-foreground)]",children:e}),a.jsx("span",{className:"text-[11px] text-[var(--app-secondary-foreground)]",children:n})]}),t&&a.jsx("div",{className:"text-[var(--app-secondary-foreground)]",children:t})]})}),ba=(e,u)=>{const t=e?e.split(`\n`).length:0,n=(u?u.split(`\n`).length:0)-t;return n>0?`+${n} lines`:n<0?`${n} lines`:"Modified"},Rt=({toolCall:e,isFirst:u,isLast:t})=>{var l,i,d,f;const{content:r,locations:n,toolCallId:o}=e,{errors:c,diffs:s}=C.useMemo(()=>G(r),[r]);if(e.status==="failed"){const b=s[0],h=(b==null?void 0:b.path)||((l=n==null?void 0:n[0])==null?void 0:l.path)||"",p=Z(e.status);return a.jsx("div",{className:`qwen-message message-item relative py-2 select-text toolcall-container toolcall-status-${p}`,"data-first":u,"data-last":t,children:a.jsxs("div",{className:"toolcall-edit-content flex flex-col gap-1 min-w-0 max-w-full",children:[a.jsx("div",{className:"flex items-center justify-between min-w-0",children:a.jsxs("div",{className:"flex items-baseline gap-2 min-w-0",children:[a.jsx("span",{className:"text-[13px] leading-none font-bold text-[var(--app-primary-foreground)]",children:"Edit"}),h&&a.jsx(j,{path:h,showFullPath:!1,className:"font-mono text-[var(--app-secondary-foreground)] hover:underline"})]})}),a.jsx("div",{className:"inline-flex text-[var(--app-secondary-foreground)] text-[0.85em] opacity-70 flex-row items-start w-full gap-1 flex items-center",children:a.jsx("span",{className:"flex-shrink-0 w-full",children:"edit failed"})})]})})}if(c.length>0){const b=((i=s[0])==null?void 0:i.path)||((d=n==null?void 0:n[0])==null?void 0:d.path)||"";return a.jsx(Yt,{label:"Edit",status:"error",toolCallId:o,isFirst:u,isLast:t,labelSuffix:b?a.jsx(j,{path:b,showFullPath:!1,className:"text-xs font-mono hover:underline"}):void 0,children:c.join(`\n`)})}if(s.length>0){const b=s[0],h=b.path||n&&((f=n[0])==null?void 0:f.path)||"",p=ba(b.oldText,b.newText),k=Z(e.status);return a.jsx("div",{className:`qwen-message message-item relative py-2 select-text toolcall-container toolcall-status-${k}`,"data-first":u,"data-last":t,children:a.jsxs("div",{className:"toolcall-edit-content flex flex-col gap-1 min-w-0 max-w-full",children:[a.jsx("div",{className:"flex items-center justify-between min-w-0",children:a.jsxs("div",{className:"flex items-baseline gap-1.5 min-w-0",children:[a.jsx("span",{className:"text-[13px] leading-none font-bold text-[var(--app-primary-foreground)]",children:"Edit"}),h&&a.jsx(j,{path:h,showFullPath:!1,className:"font-mono text-[var(--app-secondary-foreground)] hover:underline"})]})}),a.jsxs("div",{className:"inline-flex text-[var(--app-secondary-foreground)] text-[0.85em] opacity-70 flex-row items-start w-full gap-1 flex items-baseline",children:[a.jsx("span",{className:"flex-shrink-0 relative top-[-0.1em]",children:"\u23BF"}),a.jsx("span",{className:"flex-shrink-0 w-full",children:p})]})]})})}if(n&&n.length>0){const b=Z(e.status);return a.jsx(Yt,{label:"Edit",status:b,toolCallId:o,isFirst:u,isLast:t,labelSuffix:a.jsx(j,{path:n[0].path,showFullPath:!1,className:"text-xs font-mono text-[var(--app-secondary-foreground)] hover:underline"}),children:a.jsxs("div",{className:"inline-flex text-[var(--app-secondary-foreground)] text-[0.85em] opacity-70 flex-row items-start w-full gap-1 flex items-center",children:[a.jsx("span",{className:"flex-shrink-0 relative top-[-0.1em]",children:"\u23BF"}),a.jsx(j,{path:n[0].path,line:n[0].line,showFullPath:!0})]})})}return null},er=({toolCall:e,isFirst:u,isLast:t})=>{var d;const{content:r,locations:n,rawInput:o,toolCallId:c}=e,{errors:s,textOutputs:l}=G(r);let i="";if(o&&typeof o=="object"?i=o.content||"":typeof o=="string"&&(i=o),s.length>0){const f=((d=n==null?void 0:n[0])==null?void 0:d.path)||"",b=s.join(`\n`),h=i.length>200?i.substring(0,200)+"...":i;return a.jsxs(O,{label:"WriteFile",status:"error",toolCallId:c,isFirst:u,isLast:t,labelSuffix:f?a.jsx(j,{path:f,showFullPath:!1,className:"text-xs font-mono text-[var(--app-secondary-foreground)] hover:underline"}):void 0,children:[a.jsxs("div",{className:"inline-flex text-[var(--app-secondary-foreground)] text-[0.85em] opacity-70 mt-[2px] mb-[2px] flex-row items-start w-full gap-1",children:[a.jsx("span",{className:"flex-shrink-0 relative top-[-0.1em]",children:"\u23BF"}),a.jsx("span",{className:"flex-shrink-0 w-full",children:b})]}),h&&a.jsx("div",{className:"bg-[var(--app-input-background)] border border-[var(--app-input-border)] rounded-md p-3 mt-1",children:a.jsx("pre",{className:"font-mono text-[13px] whitespace-pre-wrap break-words text-[var(--app-primary-foreground)] opacity-90",children:h})})]})}if(n&&n.length>0){const f=n[0].path,b=i.split(`\n`).length,h=Z(e.status);return a.jsx(O,{label:"WriteFile",status:h,toolCallId:c,isFirst:u,isLast:t,labelSuffix:f?a.jsx(j,{path:f,showFullPath:!1,className:"text-xs font-mono text-[var(--app-secondary-foreground)] hover:underline"}):void 0,children:a.jsxs("div",{className:"inline-flex text-[var(--app-secondary-foreground)] text-[0.85em] opacity-70 flex-row items-start w-full gap-1 flex items-center",children:[a.jsx("span",{className:"flex-shrink-0 relative top-[-0.1em]",children:"\u23BF"}),a.jsxs("span",{className:"flex-shrink-0 w-full",children:[b," lines"]})]})})}if(l.length>0){const f=Z(e.status);return a.jsx(O,{label:"WriteFile",status:f,toolCallId:c,isFirst:u,isLast:t,children:l.join(`\n`)})}return null},ur=({summary:e,children:u,defaultExpanded:t=!1})=>{const[r,n]=ne(t);return a.jsxs("div",{className:"flex flex-col",children:[a.jsxs("div",{className:"inline-flex text-[var(--app-secondary-foreground)] text-[0.85em] opacity-70 mt-[2px] mb-[2px] flex-row items-start w-full gap-1 cursor-pointer hover:opacity-100 transition-opacity",role:"button",tabIndex:0,"aria-expanded":r,"aria-label":r?"Collapse output":"Expand output",onClick:()=>n(!r),onKeyDown:o=>{(o.key==="Enter"||o.key===" ")&&(o.preventDefault(),n(!r))},children:[a.jsx("span",{className:"flex-shrink-0 relative top-[-0.1em]",children:"\u23BF"}),a.jsx("span",{className:"flex-shrink-0",children:e})]}),r&&a.jsx("div",{className:"ml-4 mt-1 text-[var(--app-secondary-foreground)] text-[0.85em]",children:u})]})},tr=({label:e,children:u})=>a.jsxs("div",{className:"grid grid-cols-[80px_1fr] gap-medium min-w-0",children:[a.jsx("div",{className:"text-xs text-[var(--app-secondary-foreground)] font-medium pt-[2px]",children:e}),a.jsx("div",{className:"text-[var(--app-primary-foreground)] min-w-0 break-words",children:u})]}),xa=({children:e})=>a.jsx("div",{className:"bg-[var(--app-input-background)] border border-[var(--app-input-border)] rounded-md p-3 mt-1",children:a.jsx("div",{className:"flex flex-col gap-3 min-w-0",children:e})}),ga=({locations:e})=>a.jsx("div",{className:"flex flex-col gap-1 max-w-full",children:e.map((u,t)=>a.jsx(j,{path:u.path,line:u.line,showFullPath:!0},t))}),rr=({toolCall:e,isFirst:u,isLast:t})=>{const{kind:r,title:n,content:o,locations:c}=e,s=te(n),l=de({kind:r,title:n}),i=Z(e.status),{errors:d,textOutputs:f}=G(o);if(d.length>0)return a.jsx(O,{label:l,labelSuffix:s,status:"error",isFirst:u,isLast:t,children:a.jsxs(xa,{children:[a.jsx(tr,{label:"Query",children:a.jsx("div",{className:"font-mono",children:s})}),a.jsx(tr,{label:"Error",children:a.jsx("div",{className:"text-[#c74e39] font-medium",children:d.join(`\n`)})})]})});if(c&&c.length>0){const b=`${c.length} ${c.length===1?"file":"files"} found`;return a.jsx(O,{label:l,labelSuffix:s,status:i,isFirst:u,isLast:t,children:a.jsx(ur,{summary:b,children:a.jsx(ga,{locations:c})})})}if(f.length>0){const b=f.reduce((p,k)=>p+k.split(`\n`).length,0),h=`${b} ${b===1?"line":"lines"} of output`;return a.jsx(O,{label:l,labelSuffix:s||void 0,status:i,isFirst:u,isLast:t,children:a.jsx(ur,{summary:h,children:a.jsx("div",{className:"flex flex-col gap-1 font-mono text-[0.85em] whitespace-pre-wrap break-all",children:f.map((p,k)=>a.jsx("div",{children:p},k))})})})}return s?a.jsx(O,{label:l,labelSuffix:s,status:i,isFirst:u,isLast:t}):null};/**\n * @license\n * Copyright 2025 Qwen Team\n * SPDX-License-Identifier: Apache-2.0\n *\n * Display-only checkbox component for plan entries\n */const nr=({checked:e=!1,indeterminate:u=!1,disabled:t=!0,className:r="",style:n,title:o})=>{const c=!!e&&!u,s=!!u;return a.jsxs("span",{role:"checkbox","aria-checked":u?"mixed":!!e,"aria-disabled":t||void 0,title:o,style:n,className:["q m-[2px] shrink-0 w-4 h-4 relative rounded-[2px] box-border","border border-[var(--app-input-border)] bg-[var(--app-input-background)]","inline-flex items-center justify-center",c?"opacity-70":"",r].join(" "),children:[c?a.jsx("span",{"aria-hidden":!0,className:["absolute block","left-[3px] top-[3px]","w-2.5 h-1.5","border-l-2 border-b-2","border-[#74c991]","-rotate-45"].join(" ")}):null,s?a.jsx("span",{"aria-hidden":!0,className:["absolute inline-block","left-1/2 top-[10px] -translate-x-1/2 -translate-y-1/2","text-[16px] leading-none text-[#e1c08d] select-none"].join(" "),children:"*"}):null]})},or=({label:e,status:u="success",children:t,toolCallId:r,labelSuffix:n,className:o,isFirst:c=!1,isLast:s=!1})=>a.jsx("div",{className:`qwen-message message-item ${o||""} relative pl-[30px] py-2 select-text toolcall-container toolcall-status-${u}`,"data-first":c,"data-last":s,children:a.jsxs("div",{className:"UpdatedPlanToolCall toolcall-content-wrapper flex flex-col gap-2 min-w-0 max-w-full",children:[a.jsxs("div",{className:"flex items-baseline gap-1 relative min-w-0",children:[a.jsx("span",{className:"text-[14px] leading-none font-bold text-[var(--app-primary-foreground)]",children:e}),a.jsx("span",{className:"text-[11px] text-[var(--app-secondary-foreground)]",children:n})]}),t&&a.jsx("div",{className:"text-[var(--app-secondary-foreground)] py-1",children:t})]})}),ma=e=>{switch(e){case"completed":return"success";case"failed":return"error";case"in_progress":case"cancelled":return"warning";case"pending":return"loading";default:return"default"}},ya=e=>{const t=e.join(`\n`).split(/\\r?\\n/),r=[],n=/^(?:\\s{0,10}(?:[-*]|\\d{1,3}[.)])\\s{0,10})?\\[( |x|X|-|\\*)\\]\\s+(.{0,500})$/;for(const o of t){const c=o.match(n);if(c){const s=c[1],l=c[2].trim(),i=s==="x"||s==="X"?"completed":s==="-"||s==="*"?"in_progress":"pending";l&&r.push({content:l,status:i})}}if(r.length===0)for(const o of t){const c=o.trim();c&&r.push({content:c,status:"pending"})}return r},ar=({toolCall:e,isFirst:u,isLast:t})=>{const{content:r,status:n}=e,{errors:o,textOutputs:c}=G(r);if(o.length>0)return a.jsx(or,{label:"TodoList",status:"error",isFirst:u,isLast:t,children:o.join(`\n`)});const s=ya(c),l=de({kind:e.kind,title:te(e.title)});return a.jsx(or,{label:l,status:ma(n),className:"update-plan-toolcall",isFirst:u,isLast:t,children:a.jsx("ul",{className:"Fr list-none p-0 m-0 flex flex-col gap-1",children:s.map((i,d)=>{const f=i.status==="completed",b=i.status==="in_progress";return a.jsxs("li",{className:["Hr flex items-start gap-2 p-0 rounded text-[var(--app-primary-foreground)]",f?"fo opacity-70":""].join(" "),children:[a.jsx("label",{className:"flex items-start gap-2",children:a.jsx(nr,{checked:f,indeterminate:b})}),a.jsx("div",{className:["vo flex-1 text-xs leading-[1.5] text-[var(--app-primary-foreground)]",f?"line-through text-[var(--app-secondary-foreground)] opacity-70":"opacity-85"].join(" "),children:i.content})]},d)})})})},ka=({label:e,status:u="success",children:t,toolCallId:r,labelSuffix:n,className:o,isFirst:c=!1,isLast:s=!1})=>a.jsx("div",{className:`ExecuteToolCall qwen-message message-item ${o||""} relative pl-[30px] py-2 select-text toolcall-container toolcall-status-${u}`,"data-first":c,"data-last":s,children:a.jsxs("div",{className:"toolcall-content-wrapper flex flex-col min-w-0 max-w-full",children:[a.jsxs("div",{className:"flex items-baseline gap-1.5 relative min-w-0",children:[a.jsx("span",{className:"text-[14px] leading-none font-bold text-[var(--app-primary-foreground)]",children:e}),a.jsx("span",{className:"text-[11px] text-[var(--app-secondary-foreground)]",children:n})]}),t&&a.jsx("div",{className:"text-[var(--app-secondary-foreground)]",children:t})]})}),va=(e,u,t)=>{if(e==="execute"&&t&&typeof t=="object"){const r=t.description,n=te(r);if(n)return n}return te(u)},wa=(e,u)=>u&&typeof u=="object"?u.command||e:typeof u=="string"?u:e,_a=({toolCall:e,variant:u,isFirst:t,isLast:r})=>{const{title:n,content:o,rawInput:c,toolCallId:s}=e,l=u,i=re(),d=(_,v)=>{if(i.openTempFile){i.openTempFile(_,v);return}i.postMessage({type:"createAndOpenTempFile",data:{content:_,fileName:v}})},f=va(u,n,c),b=wa(f,c),h=u==="execute"?ka:O,p=de({kind:e.kind,title:n}),{textOutputs:k,errors:y}=G(o),D=()=>{d(b,`${l}-input-${s}`)},x=()=>{if(k.length>0){const _=k.join(`\n`);d(_,`${l}-output-${s}`)}},m=y.length>0||u==="execute"&&e.status==="failed"?"error":Z(e.status);if(y.length>0)return a.jsxs(h,{label:p,status:m,toolCallId:s,isFirst:t,isLast:r,children:[a.jsxs("div",{className:"inline-flex text-[var(--app-secondary-foreground)] text-[0.85em] opacity-70 mt-[2px] mb-[2px] flex-row items-start w-full gap-1",children:[a.jsx("span",{className:"flex-shrink-0 relative top-[-0.1em]",children:"\u23BF"}),a.jsx("span",{className:"flex-shrink-0 w-full",children:f})]}),a.jsx("div",{className:`${l}-toolcall-card`,children:a.jsxs("div",{className:`${l}-toolcall-content`,children:[a.jsxs("div",{className:`${l}-toolcall-row ${l}-toolcall-row-with-copy group`,onClick:D,style:{cursor:"pointer"},children:[a.jsx("div",{className:`${l}-toolcall-label`,children:"IN"}),a.jsx("div",{className:`${l}-toolcall-row-content`,children:a.jsx("pre",{className:`${l}-toolcall-pre`,children:b})}),a.jsx(fu,{text:b})]}),a.jsxs("div",{className:`${l}-toolcall-row`,children:[a.jsx("div",{className:`${l}-toolcall-label`,children:"Error"}),a.jsx("div",{className:`${l}-toolcall-row-content`,children:a.jsx("pre",{className:`${l}-toolcall-pre ${l}-toolcall-error-content`,children:y.join(`\n`)})})]})]})})]});if(k.length>0){const _=k.join(`\n`),v=_.length>500,w=a.jsx("div",{className:`${l}-toolcall-output-subtle`,children:a.jsx("pre",{className:`${l}-toolcall-pre`,children:_})});return a.jsxs(h,{label:p,status:m,toolCallId:s,isFirst:t,isLast:r,children:[a.jsxs("div",{className:"inline-flex text-[var(--app-secondary-foreground)] text-[0.85em] opacity-70 mt-[2px] mb-[2px] flex-row items-start w-full gap-1",children:[a.jsx("span",{className:"flex-shrink-0 relative top-[-0.1em]",children:"\u23BF"}),a.jsx("span",{className:"flex-shrink-0 w-full",children:f})]}),a.jsx("div",{className:`${l}-toolcall-card`,children:a.jsxs("div",{className:`${l}-toolcall-content`,children:[a.jsxs("div",{className:`${l}-toolcall-row ${l}-toolcall-row-with-copy group`,onClick:D,style:{cursor:"pointer"},children:[a.jsx("div",{className:`${l}-toolcall-label`,children:"IN"}),a.jsx("div",{className:`${l}-toolcall-row-content`,children:a.jsx("pre",{className:`${l}-toolcall-pre`,children:b})}),a.jsx(fu,{text:b})]}),a.jsxs("div",{className:`${l}-toolcall-row`,onClick:x,style:{cursor:"pointer"},children:[a.jsx("div",{className:`${l}-toolcall-label`,children:"OUT"}),a.jsx("div",{className:`${l}-toolcall-row-content ${v?`${l}-toolcall-full`:""}`,children:v?a.jsx(du,{isCollapsible:!0,collapsedHeight:60,fadeStart:40,children:w}):w})]})]})})]})}return a.jsx(h,{label:p,status:m,toolCallId:s,isFirst:t,isLast:r,children:a.jsxs("div",{className:"inline-flex text-[var(--app-secondary-foreground)] text-[0.85em] opacity-70 mt-[2px] mb-[2px] flex-row items-start w-full gap-1",onClick:D,style:{cursor:"pointer"},children:[a.jsx("span",{className:"flex-shrink-0 relative top-[-0.1em]",children:"\u23BF"}),a.jsx("span",{className:"flex-shrink-0 w-full",children:f})]})})},cr=e=>{const t=e.toolCall.kind.toLowerCase()==="execute"?"execute":"bash";return a.jsx(_a,{...e,variant:t})},Ee=({label:e,status:u="success",children:t,toolCallId:r,labelSuffix:n,className:o,isFirst:c=!1,isLast:s=!1})=>a.jsx("div",{className:`ReadToolCall qwen-message message-item ${o||""} relative pl-[30px] py-2 select-text toolcall-container toolcall-status-${u}`,"data-first":c,"data-last":s,children:a.jsxs("div",{className:"toolcall-content-wrapper flex flex-col gap-1 min-w-0 max-w-full",children:[a.jsxs("div",{className:"flex items-baseline gap-1.5 relative min-w-0",children:[a.jsx("span",{className:"text-[14px] leading-none font-bold text-[var(--app-primary-foreground)]",children:e}),a.jsx("span",{className:"text-[11px] text-[var(--app-secondary-foreground)]",children:n})]}),t&&a.jsx("div",{className:"text-[var(--app-secondary-foreground)] py-0.5",children:t})]})}),sr=({toolCall:e,isFirst:u,isLast:t})=>{var x,m,_,v;const{kind:r,title:n,content:o,locations:c,toolCallId:s}=e,l=re(),i=C.useRef(new Map),[d,f]=ne(!1),{errors:b,diffs:h,textOutputs:p}=C.useMemo(()=>G(o),[o]),k=C.useCallback((w,N,F)=>{if(w){if(l.openDiff){l.openDiff(w,N,F);return}l.postMessage({type:"openDiff",data:{path:w,oldText:N??"",newText:F??""}})}},[l]);C.useEffect(()=>{var S;if(h.length===0)return;const w=h[0],N=w.path||((S=c==null?void 0:c[0])==null?void 0:S.path)||"";if(!N||w.oldText===void 0||w.newText===void 0)return;const F=`${N}:${w.oldText??""}:${w.newText??""}`;if(i.current.get(s)===F)return;i.current.set(s,F);const A=setTimeout(()=>{k(N,w.oldText,w.newText)},100);return()=>clearTimeout(A)},[h,k,c,s]);const y=Z(e.status),D=de({kind:r,title:n});if(b.length>0){const w=((x=c==null?void 0:c[0])==null?void 0:x.path)||"";return a.jsx(Ee,{label:D,className:"read-tool-call-error",status:"error",toolCallId:s,isFirst:u,isLast:t,labelSuffix:w?a.jsx(j,{path:w,showFullPath:!1,className:"text-xs font-mono text-[var(--app-secondary-foreground)] hover:underline"}):void 0,children:b.join(`\n`)})}if(e.status==="failed"){const w=((m=c==null?void 0:c[0])==null?void 0:m.path)||"",N=p.length>0?p.join(`\n`):"Read operation failed";return a.jsx(Ee,{label:D,className:"read-tool-call-error",status:"error",toolCallId:s,isFirst:u,isLast:t,labelSuffix:w?a.jsx(j,{path:w,showFullPath:!1,className:"text-xs font-mono text-[var(--app-secondary-foreground)] hover:underline"}):void 0,children:N})}if(h.length>0){const w=((_=h[0])==null?void 0:_.path)||((v=c==null?void 0:c[0])==null?void 0:v.path)||"";return a.jsx(Ee,{label:D,className:"read-tool-call-success",status:y,toolCallId:s,isFirst:u,isLast:t,labelSuffix:w?a.jsx(j,{path:w,showFullPath:!1,className:"text-xs font-mono text-[var(--app-secondary-foreground)] hover:underline"}):void 0,children:null})}if(c&&c.length>0){const w=c[0].path,N=p.length>0?p.join(`\n`):"",E=N.length>300;return a.jsx(Ee,{label:D,className:"read-tool-call-success",status:y,toolCallId:s,isFirst:u,isLast:t,labelSuffix:w?a.jsx(j,{path:w,showFullPath:!1,className:"text-xs font-mono text-[var(--app-secondary-foreground)] hover:underline"}):void 0,children:N?a.jsxs("div",{className:"border border-[var(--app-input-border)] rounded-[5px] bg-[var(--app-tool-background)] overflow-hidden",children:[a.jsx("div",{className:`p-2 ${!d&&E?"max-h-[100px] overflow-hidden":""}`,style:!d&&E?{maskImage:"linear-gradient(to bottom, var(--app-primary-background) 60px, transparent 100px)"}:void 0,children:a.jsx("pre",{className:"whitespace-pre-wrap break-words text-xs font-mono m-0",children:N})}),E&&a.jsx("button",{onClick:()=>f(!d),"aria-expanded":d,"aria-label":d?"Collapse output":"Expand output",className:"flex items-center justify-center w-full py-1 px-2 border-t border-[var(--app-input-border)] cursor-pointer text-[var(--app-secondary-foreground)] text-[0.75em] opacity-70 hover:opacity-100 hover:bg-[var(--app-code-background)] transition-opacity bg-transparent",children:d?"\u25B2 Collapse":"\u25BC Show more"})]}):null})}if(p.length>0){const w=p.join(`\n`),F=w.length>300;return a.jsx(Ee,{label:D,className:"read-tool-call-success",status:y,toolCallId:s,isFirst:u,isLast:t,children:a.jsxs("div",{className:"border border-[var(--app-input-border)] rounded-[5px] bg-[var(--app-tool-background)] overflow-hidden",children:[a.jsx("div",{className:`p-2 ${!d&&F?"max-h-[100px] overflow-hidden":""}`,style:!d&&F?{maskImage:"linear-gradient(to bottom, var(--app-primary-background) 60px, transparent 100px)"}:void 0,children:a.jsx("pre",{className:"whitespace-pre-wrap break-words text-xs font-mono m-0",children:w})}),F&&a.jsx("button",{onClick:()=>f(!d),"aria-expanded":d,"aria-label":d?"Collapse output":"Expand output",className:"flex items-center justify-center w-full py-1 px-2 border-t border-[var(--app-input-border)] cursor-pointer text-[var(--app-secondary-foreground)] text-[0.75em] opacity-70 hover:opacity-100 hover:bg-[var(--app-code-background)] transition-opacity bg-transparent",children:d?"\u25B2 Collapse":"\u25BC Show more"})]})})}return null},hu=120,Ca=300,Ea=(e,u,t)=>{if(t&&typeof t=="object"){const r=t;if(e==="fetch"&&r.url)return String(r.url);if(e==="search"&&r.query)return String(r.query)}return te(u)},lr=({content:e,isError:u=!1})=>{const[t,r]=ne(!1),n=e.length>Ca;return a.jsx("div",{className:"border-[0.5px] border-[var(--app-input-border)] rounded-[5px] bg-[var(--app-tool-background)] my-2 max-w-full text-[1em] items-start",children:a.jsxs("div",{className:"flex flex-col gap-[3px] p-1",children:[a.jsxs("div",{className:"grid grid-cols-[max-content_1fr] p-1",children:[a.jsx("div",{className:"text-[var(--app-secondary-foreground)] text-left opacity-50 py-1 px-2 pl-1 font-mono text-[0.85em]",children:"OUT"}),a.jsx("div",{className:`webfetch-output-content break-words m-0 p-1 overflow-hidden ${u?"whitespace-pre-wrap":""}`,style:!t&&n?{maxHeight:`${hu}px`,maskImage:`linear-gradient(to bottom, var(--app-primary-background) 80px, transparent ${hu}px)`,WebkitMaskImage:`linear-gradient(to bottom, var(--app-primary-background) 80px, transparent ${hu}px)`}:void 0,children:u?a.jsx("pre",{className:"m-0 overflow-hidden font-mono text-[0.85em] text-[#c74e39]",children:e}):a.jsx("div",{className:"text-[0.85em]",children:a.jsx(_e,{content:e,enableFileLinks:!1})})})]}),n&&a.jsx("div",{className:"flex justify-center border-t border-[var(--app-input-border)] pt-1",children:a.jsx("button",{type:"button",onClick:o=>{o.stopPropagation(),r(!t)},"aria-expanded":t,"aria-label":t?"Collapse output":"Expand output",className:"text-[var(--app-secondary-foreground)] text-[0.8em] hover:text-[var(--app-primary-foreground)] cursor-pointer bg-transparent border-none px-2 py-1 rounded hover:bg-[var(--app-input-background)] transition-colors",children:t?"\u25B2 Collapse":"\u25BC Show more"})})]})})},Da=({toolCall:e,variant:u,isFirst:t,isLast:r})=>{const{title:n,content:o,rawInput:c,toolCallId:s}=e,l=Ea(u,n,c),i=de({kind:e.kind,title:n}),{textOutputs:d,errors:f}=G(o),b=f.length>0?"error":Z(e.status);if(f.length>0)return a.jsx(O,{label:i,status:b,toolCallId:s,isFirst:t,isLast:r,labelSuffix:l,children:a.jsx(lr,{content:f.join(`\n`),isError:!0})});if(d.length>0){const h=d.join(`\n`);return a.jsx(O,{label:i,status:b,toolCallId:s,isFirst:t,isLast:r,labelSuffix:l,children:a.jsx(lr,{content:h})})}return a.jsx(O,{label:i,status:b,toolCallId:s,isFirst:t,isLast:r,labelSuffix:l})},ir=e=>a.jsx(Da,{...e,variant:"fetch"});/**\n * @license\n * Copyright 2025 Qwen Team\n * SPDX-License-Identifier: Apache-2.0\n *\n * Shared tool-call routing \u2014 maps ToolCallData to the appropriate\n * specialized component. Used by both ChatViewer and VSCode IDE.\n */function dr(e){if(pu(e))return Kt;switch(e.kind.toLowerCase()){case"read":case"read_file":case"read_many_files":case"readmanyfiles":case"list_directory":case"listfiles":return sr;case"write":return er;case"edit":return Rt;case"execute":case"bash":case"command":return cr;case"updated_plan":case"updatedplan":case"todo_write":case"update_todos":case"todowrite":return ar;case"search":case"grep":case"glob":case"find":return rr;case"think":case"thinking":return Gt;case"fetch":case"web_fetch":case"webfetch":case"web_search":return ir;default:return Jt}}/**\n * @license\n * Copyright 2026 Qwen Team\n * SPDX-License-Identifier: Apache-2.0\n */const fr="<qwen:user-prompt-submit-context>",pr="</qwen:user-prompt-submit-context>";function bu(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Aa(e){if(!bu(e)||typeof e.text!="string")return!1;const u=e.text.trim(),t=`${fr}\n`,r=`\n${pr}`;if(!u.startsWith(t)||!u.endsWith(r))return!1;const n=u.slice(t.length,-r.length);return!n.includes(fr)&&!n.includes(pr)}function hr(e){var o;if(e.type!=="user")return;const u=Array.isArray((o=e.message)==null?void 0:o.parts)?e.message.parts:[],t=u.length>1&&Aa(u[u.length-1]),r=bu(e.systemPayload)?e.systemPayload:void 0;return r&&typeof r.displayText=="string"&&(typeof r.hookContext=="string"||t)?r.displayText:u.length===0?void 0:(r===void 0&&t?u.slice(0,-1):u).map(c=>bu(c)&&typeof c.text=="string"?c.text:"").join("")}function Fa(e){return e?e.parts&&Array.isArray(e.parts)?e.parts.map(u=>u.text||"").join(""):typeof e.content=="string"?e.content:Array.isArray(e.content)?e.content.filter(u=>u.type==="text"&&u.text).map(u=>u.text||"").join(""):"":""}function xu(e){const u=new Date(e);return isNaN(u.getTime())?Date.now():u.getTime()}const gu=C.forwardRef(({messages:e,className:u="",onFileClick:t,emptyMessage:r="No messages to display",autoScroll:n=!0,theme:o="auto",showEmptyIcon:c=!0,showExpandControl:s=!1},l)=>{const i=C.useRef(null),d=C.useRef(null),f=C.useRef(0),[b,h]=C.useState({signal:0,expanded:!1}),p=v=>{h(w=>({signal:w.signal+1,expanded:v}))},k=C.useMemo(()=>e.filter(v=>v.type==="system"?!1:v.type==="tool_call"&&v.toolCall?Wt(v.toolCall.kind):!0).sort((v,w)=>xu(v.timestamp)-xu(w.timestamp)),[e]);C.useImperativeHandle(l,()=>({scrollToBottom:(v="smooth")=>{const w=i.current;w&&w.scrollTo({top:w.scrollHeight,behavior:v})},scrollToTop:(v="smooth")=>{const w=i.current;w&&w.scrollTo({top:0,behavior:v})},getScrollContainer:()=>i.current}),[]),C.useEffect(()=>{if(!n)return;const v=k.length,w=f.current;v>w&&d.current&&d.current.scrollIntoView({behavior:"smooth"}),f.current=v},[k.length,n]);const y=v=>!v||v.type==="user",D=(v,w,N)=>{var z;const F=v.uuid||`msg-${w}`,E=N[w-1],A=N[w+1],S=y(E),T=y(A);if(v.type==="tool_call"&&v.toolCall){const pe=dr(v.toolCall);return pe?a.jsx(pe,{toolCall:v.toolCall,isFirst:S,isLast:T},F):null}const L=hr(v)??Fa(v.message),I=xu(v.timestamp);if(!L.trim())return null;switch(v.type){case"user":return a.jsx(Ot,{content:L,timestamp:I,onFileClick:t},F);case"assistant":return((z=v.message)==null?void 0:z.role)==="thinking"?a.jsx(jt,{content:L,timestamp:I,onFileClick:t},F):a.jsx(Ht,{content:L,timestamp:I,onFileClick:t,isFirst:S,isLast:T},F);default:return null}},x=["chat-viewer-container",o==="light"?"light-theme":"",o==="auto"?"auto-theme":"",u].filter(Boolean).join(" "),m=s&&k.length>0,_=a.jsx("div",{ref:i,className:"chat-viewer-messages chat-messages",children:k.length===0?a.jsxs("div",{className:"chat-viewer-empty",children:[c&&a.jsx("div",{className:"chat-viewer-empty-icon","aria-hidden":"true",children:"\u{1F4AC}"}),a.jsx("div",{className:"chat-viewer-empty-text",children:r})]}):a.jsxs(a.Fragment,{children:[k.map((v,w)=>D(v,w,k)),a.jsx("div",{ref:d,className:"chat-viewer-scroll-anchor"})]})});return a.jsxs("div",{className:x,children:[m&&a.jsxs("div",{className:"chat-viewer-expand-control",role:"toolbar","aria-label":"Expand or collapse all sections",children:[a.jsx("button",{type:"button",className:"chat-viewer-expand-control-button","aria-label":"Expand all sections",onClick:()=>p(!0),children:"Expand all"}),a.jsx("button",{type:"button",className:"chat-viewer-expand-control-button","aria-label":"Collapse all sections",onClick:()=>p(!1),children:"Collapse all"})]}),s?a.jsx(Fe.Provider,{value:b,children:_}):_]})});gu.displayName="ChatViewer";const br=C.forwardRef(({children:e,variant:u="primary",size:t="md",disabled:r=!1,loading:n=!1,leftIcon:o,rightIcon:c,fullWidth:s=!1,className:l="",type:i="button",...d},f)=>{const b=r||n,h="inline-flex items-center justify-center rounded font-medium transition-colors focus:outline-none focus:ring-2 focus:ring-offset-2",p={primary:"bg-blue-600 text-white hover:bg-blue-700 focus:ring-blue-500",secondary:"bg-gray-200 text-gray-800 hover:bg-gray-300 focus:ring-gray-500",danger:"bg-red-600 text-white hover:bg-red-700 focus:ring-red-500",ghost:"bg-transparent text-gray-700 hover:bg-gray-100 focus:ring-gray-400",outline:"bg-transparent border border-gray-300 text-gray-700 hover:bg-gray-50 focus:ring-gray-400"},k={sm:"px-2 py-1 text-sm gap-1",md:"px-4 py-2 gap-2",lg:"px-6 py-3 text-lg gap-2"},y=b?"opacity-50 cursor-not-allowed pointer-events-none":"",D=s?"w-full":"";return a.jsxs("button",{ref:f,type:i,className:`${h} ${p[u]} ${k[t]} ${y} ${D} ${l}`.trim(),disabled:b,"aria-disabled":b,"aria-busy":n,...d,children:[n&&a.jsxs("svg",{className:"animate-spin h-4 w-4",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true",children:[a.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),a.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),!n&&o,e,!n&&c]})});br.displayName="Button";const xr=C.forwardRef(({size:e="md",error:u=!1,errorMessage:t,label:r,helperText:n,leftElement:o,rightElement:c,fullWidth:s=!1,className:l="",id:i,disabled:d,...f},b)=>{const h=i||`input-${Math.random().toString(36).substr(2,9)}`,p="border rounded transition-colors focus:outline-none focus:ring-2",k={sm:"px-2 py-1 text-sm",md:"px-3 py-2",lg:"px-4 py-3 text-lg"},y=u?"border-red-500 focus:ring-red-500 focus:border-red-500":"border-gray-300 focus:ring-blue-500 focus:border-blue-500",D=d?"bg-gray-100 cursor-not-allowed opacity-60":"bg-white",x=s?"w-full":"",m=[o?"pl-10":"",c?"pr-10":""].join(" ");return a.jsxs("div",{className:`${s?"w-full":"inline-block"}`,children:[r&&a.jsx("label",{htmlFor:h,className:"block text-sm font-medium text-gray-700 mb-1",children:r}),a.jsxs("div",{className:"relative",children:[o&&a.jsx("div",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-gray-500",children:o}),a.jsx("input",{ref:b,id:h,disabled:d,"aria-invalid":u,"aria-describedby":t?`${h}-error`:n?`${h}-helper`:void 0,className:`${p} ${k[e]} ${y} ${D} ${x} ${m} ${l}`.trim(),...f}),c&&a.jsx("div",{className:"absolute right-3 top-1/2 -translate-y-1/2 text-gray-500",children:c})]}),t&&u&&a.jsx("p",{id:`${h}-error`,className:"mt-1 text-sm text-red-600",children:t}),n&&!u&&a.jsx("p",{id:`${h}-helper`,className:"mt-1 text-sm text-gray-500",children:n})]})});xr.displayName="Input";/**\n * @license\n * Copyright 2025 Qwen Team\n * SPDX-License-Identifier: Apache-2.0\n */const Na="agent";function gr(e){return e===Na}const Sa=({isOpen:e,options:u,toolCall:t,onResponse:r,onClose:n})=>{const[o,c]=C.useState(0),s=C.useRef(null),l=()=>{var k,y,D;const h=(y=(k=t.locations)==null?void 0:k[0])==null?void 0:y.path;if(h)return h.split("/").pop()||h;const p=Array.isArray(t.content)?(D=t.content.find(x=>typeof x=="object"&&x!==null&&"path"in x))==null?void 0:D.path:void 0;return typeof p=="string"&&p.length>0?p.split("/").pop()||p:"file"},i=()=>{if(gr(t.toolName))return"Launch this agent?";if(t.kind==="edit"||t.kind==="write"){const h=l();return a.jsxs(a.Fragment,{children:["Make this edit to"," ",a.jsx("span",{className:"font-mono text-[var(--app-primary-foreground)]",children:h}),"?"]})}if(t.kind==="execute"||t.kind==="bash")return"Allow this bash command?";if(t.kind==="read"){const h=l();return a.jsxs(a.Fragment,{children:["Allow read from"," ",a.jsx("span",{className:"font-mono text-[var(--app-primary-foreground)]",children:h}),"?"]})}return t.kind==="switch_mode"?"Would you like to proceed?":t.title||"Permission Required"};C.useEffect(()=>{const h=p=>{var y,D;if(!e)return;if(p.key.match(/^[1-9]$/)){const x=parseInt(p.key,10)-1;x<u.length&&(p.preventDefault(),r(u[x].optionId));return}if(p.key==="ArrowDown"||p.key==="ArrowUp"){if(p.preventDefault(),u.length===0)return;const x=u.length;p.key==="ArrowDown"?c(m=>(m+1)%x):c(m=>(m-1+x)%x)}if(p.key==="Enter"&&(p.preventDefault(),o<u.length&&r(u[o].optionId)),p.key==="Escape"){p.preventDefault();const x=((y=u.find(m=>m.kind.includes("reject")))==null?void 0:y.optionId)||((D=u.find(m=>m.optionId==="cancel"))==null?void 0:D.optionId)||"cancel";r(x),n&&n()}};return window.addEventListener("keydown",h),()=>window.removeEventListener("keydown",h)},[e,u,r,n,o]),C.useEffect(()=>{e&&s.current&&s.current.focus()},[e]),C.useEffect(()=>{e&&c(0)},[e,u.length]);const d=C.useMemo(()=>{if(!Array.isArray(t.content))return null;const h=[];for(const p of t.content){const k=p.type,y=p.content;if(k==="content"&&typeof y=="object"&&y!==null){const D=y;D.type==="text"&&typeof D.text=="string"&&h.push(D.text)}}return h.length>0?h.join(`\n\n`):null},[t.content]),f=t.kind==="switch_mode"?d:null,b=t.kind==="edit"||t.kind==="write"?d:null;return e?a.jsx("div",{className:"fixed inset-x-0 bottom-0 z-[1000] p-2",children:a.jsxs("div",{ref:s,className:`relative flex flex-col rounded-large border p-2 outline-none animate-slide-up${f||b?" max-h-[60vh]":""}`,style:{backgroundColor:"var(--app-input-secondary-background)",borderColor:"var(--app-input-border)"},tabIndex:0,"data-focused-index":o,children:[a.jsx("div",{className:"p-2 absolute inset-0 rounded-large",style:{backgroundColor:"var(--app-input-background)"}}),a.jsxs("div",{className:"relative z-[1] text-[1.1em] text-[var(--app-primary-foreground)] flex flex-col min-h-0",children:[a.jsx("div",{className:"font-bold text-[var(--app-primary-foreground)] mb-0.5",children:i()}),(t.kind==="edit"||t.kind==="write"||t.kind==="read"||t.kind==="execute"||t.kind==="bash"||gr(t.toolName))&&t.title&&a.jsx("div",{className:"text-[13px] font-normal text-[var(--app-secondary-foreground)] opacity-90 font-mono whitespace-normal break-words q-line-clamp-3 mb-2",style:{fontSize:".9em",color:"var(--app-secondary-foreground)",marginBottom:"6px"},title:t.title,children:t.title})]}),f&&a.jsx("div",{className:"relative z-[1] overflow-y-auto mb-2 rounded-[4px] max-h-[40vh] py-2 px-3 text-[13px] leading-normal bg-[var(--app-primary-background)] border border-[var(--app-input-border)] [scrollbar-width:thin] [&::-webkit-scrollbar]:w-1.5 [&::-webkit-scrollbar-track]:bg-transparent [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-thumb]:bg-[var(--app-foreground-muted)]/30",children:a.jsx(_e,{content:f})}),b&&a.jsx("pre",{className:"relative z-[1] overflow-y-auto mb-2 rounded-[4px] max-h-[40vh] py-2 px-3 text-[13px] leading-normal whitespace-pre-wrap break-words bg-[var(--app-primary-background)] border border-[var(--app-input-border)] [scrollbar-width:thin] [&::-webkit-scrollbar]:w-1.5 [&::-webkit-scrollbar-track]:bg-transparent [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-thumb]:bg-[var(--app-foreground-muted)]/30",children:b}),a.jsx("div",{className:"relative z-[1] flex flex-col gap-1 pb-1",children:u.map((h,p)=>{const k=o===p;return a.jsxs("button",{className:`flex items-center gap-2 px-2 py-1.5 text-left w-full box-border rounded-[4px] border-0 shadow-[inset_0_0_0_1px_var(--app-transparent-inner-border)] transition-colors duration-150 text-[var(--app-primary-foreground)] hover:bg-[var(--app-button-background)] ${k?"text-[var(--app-list-active-foreground)] bg-[var(--app-list-active-background)] hover:text-[var(--app-button-foreground)] hover:font-bold hover:relative hover:border-0":"hover:bg-[var(--app-button-background)] hover:text-[var(--app-button-foreground)] hover:font-bold hover:relative hover:border-0"}`,onClick:()=>r(h.optionId),onMouseEnter:()=>c(p),children:[a.jsx("span",{className:"inline-flex items-center justify-center min-w-[10px] h-5 font-semibold opacity-60",children:p+1}),a.jsx("span",{className:"font-semibold",children:h.name})]},h.optionId)})})]})}):null};/**\n * @license\n * Copyright 2025 Qwen Team\n * SPDX-License-Identifier: Apache-2.0\n */const Ta=({name:e,size:u=24,color:t="currentColor",className:r=""})=>a.jsx("svg",{width:u,height:u,viewBox:"0 0 24 24",fill:t,className:r,children:a.jsx("text",{x:"50%",y:"50%",dominantBaseline:"middle",textAnchor:"middle",fontSize:"10",children:e})});/**\n * @license\n * Copyright 2025 Qwen Team\n * SPDX-License-Identifier: Apache-2.0\n */const Ia=({size:e=24,color:u="currentColor",className:t=""})=>a.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:u,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:[a.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),a.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]});/**\n * @license\n * Copyright 2025 Qwen Team\n * SPDX-License-Identifier: Apache-2.0\n */const Ma=({size:e=24,color:u="currentColor",className:t=""})=>a.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:u,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:[a.jsx("line",{x1:"22",y1:"2",x2:"11",y2:"13"}),a.jsx("polygon",{points:"22 2 15 22 11 13 2 9 22 2"})]});/**\n * @license\n * Copyright 2025 Qwen Team\n * SPDX-License-Identifier: Apache-2.0\n */const La=()=>{const[e,u]=C.useState("auto");return C.useEffect(()=>{const r=localStorage.getItem("theme");if(r)u(r);else{const n=window.matchMedia("(prefers-color-scheme: dark)").matches;u(n?"dark":"light")}},[]),{theme:e,toggleTheme:()=>{const r=e==="light"?"dark":"light";u(r),localStorage.setItem("theme",r)}}};/**\n * @license\n * Copyright 2025 Qwen Team\n * SPDX-License-Identifier: Apache-2.0\n */const Pa=(e,u)=>{const[t,r]=C.useState(()=>{try{const c=window.localStorage.getItem(e);return c?JSON.parse(c):u}catch{return u}}),n=c=>{r(s=>{try{return c instanceof Function?c(s):c}catch(l){return console.error(l),s}})},o=C.useRef(null);return C.useEffect(()=>{const c=JSON.stringify(t);if(o.current===c)return;const s=o.current===null;if(o.current=c,!s)try{window.localStorage.setItem(e,c)}catch(l){console.error(l)}},[e,t]),[t,n]};/**\n * @license\n * Copyright 2025 Qwen Team\n * SPDX-License-Identifier: Apache-2.0\n */const fe=Object.freeze({suggestion:null,isVisible:!1,shownAt:0});/**\n * @license\n * Copyright 2025 Qwen Team\n * SPDX-License-Identifier: Apache-2.0\n */const Ba=300,$a=100;function Oa(e){const{enabled:u=!0,onStateChange:t,getOnAccept:r,onOutcome:n}=e;let o=fe,c=null,s=!1,l=null;function i(y){o=y,t(y)}function d(){c&&(clearTimeout(c),c=null),l&&(clearTimeout(l),l=null)}return{setSuggestion:y=>{if(c&&(clearTimeout(c),c=null),!y){i(fe);return}u&&(c=setTimeout(()=>{i({suggestion:y,isVisible:!0,shownAt:Date.now()})},Ba))},accept:(y,D)=>{if(s)return;c&&(clearTimeout(c),c=null),s=!0;const x=o.suggestion,{shownAt:m}=o;if(!x){s=!1;return}try{n==null||n({outcome:"accepted",accept_method:y,time_ms:m>0?Date.now()-m:0,suggestion_length:x.length})}catch(_){console.error("[followup] onOutcome callback threw:",_)}i(fe),queueMicrotask(()=>{var _;try{D!=null&&D.skipOnAccept||(_=r==null?void 0:r())==null||_(x)}catch(v){console.error("[followup] onAccept callback threw:",v)}finally{l&&clearTimeout(l),l=setTimeout(()=>{s=!1},$a)}})},dismiss:()=>{if(c&&(clearTimeout(c),c=null),!(!o.isVisible&&!o.suggestion)){if(o.isVisible&&o.suggestion)try{n==null||n({outcome:"ignored",time_ms:o.shownAt>0?Date.now()-o.shownAt:0,suggestion_length:o.suggestion.length})}catch(y){console.error("[followup] onOutcome callback threw:",y)}i(fe)}},clear:()=>{d(),s=!1,i(fe)},cleanup:()=>{d(),s=!1}}}function za(e={}){const{enabled:u=!0,onAccept:t,onOutcome:r}=e,[n,o]=C.useState(fe),c=C.useRef(t);c.current=t;const s=C.useRef(r);s.current=r;const l=C.useMemo(()=>Oa({enabled:u,onStateChange:o,getOnAccept:()=>c.current,onOutcome:d=>{var f;return(f=s.current)==null?void 0:f.call(s,d)}}),[u]);C.useEffect(()=>(u||l.clear(),()=>l.cleanup()),[l,u]);const i=C.useCallback(d=>n.isVisible&&n.suggestion?n.suggestion:d,[n.isVisible,n.suggestion]);return C.useMemo(()=>({state:n,getPlaceholder:i,setSuggestion:l.setSuggestion,accept:l.accept,dismiss:l.dismiss,clear:l.clear}),[n,i,l])}/**\n * @license\n * Copyright 2025 Qwen Team\n * SPDX-License-Identifier: Apache-2.0\n *\n * Adapter for JSONL format messages (used by ChatViewer)\n */function ja(e){var u;return e?(u=e.parts)!=null&&u.length?e.parts.map(t=>t.text).join(""):typeof e.content=="string"?e.content:Array.isArray(e.content)?e.content.filter(t=>typeof t=="object"&&t!==null&&"type"in t&&t.type==="text").map(t=>t.text).join(""):"":""}function mu(e){const u=Date.parse(e);return isNaN(u)?Date.now():u}function qa(e){var u;return e.type==="tool_call"?"tool_call":e.type==="user"?"user":((u=e.message)==null?void 0:u.role)==="thinking"?"thinking":"assistant"}function mr(e){return!e||e.type==="user"}function Ha(e){return[...e].sort((t,r)=>mu(t.timestamp)-mu(r.timestamp)).map((t,r,n)=>{const o=n[r-1],c=n[r+1],s=mr(o),l=mr(c),i=qa(t),d=hr(t);return{id:t.uuid,type:i,timestamp:mu(t.timestamp),content:i!=="tool_call"?d??ja(t.message):void 0,toolCall:t.toolCall,isFirst:s,isLast:l}})}function Za(e){return e.filter(u=>u.type==="tool_call"?!0:u.content&&u.content.trim().length>0)}/**\n * @license\n * Copyright 2025 Qwen Team\n * SPDX-License-Identifier: Apache-2.0\n *\n * Adapter for ACP protocol messages (used by vscode-ide-companion)\n */function yr(e){if(!e)return!0;if(e.type!=="message")return!1;const u=e.data;return(u==null?void 0:u.role)==="user"}function Va(e){return e.map((u,t,r)=>{const n=r[t-1],o=r[t+1],c=yr(n),s=yr(o);switch(u.type){case"message":{const l=u.data;return{id:`msg-${t}`,type:l.role==="user"?"user":l.role==="thinking"?"thinking":"assistant",timestamp:l.timestamp||Date.now(),content:l.content,fileContext:l.fileContext,isFirst:c,isLast:s}}case"in-progress-tool-call":case"completed-tool-call":{const l=u.data;return{id:`tool-${l.toolCallId}-${u.type}`,type:"tool_call",timestamp:Date.now(),toolCall:l,isFirst:c,isLast:s}}default:return{id:`unknown-${t}`,type:"assistant",timestamp:Date.now(),content:"",isFirst:c,isLast:s}}})}function Ua(e){return typeof e=="object"&&e!==null&&"toolCallId"in e&&"kind"in e}function Wa(e){return typeof e=="object"&&e!==null&&"role"in e&&"content"in e}const Ga=({children:e,className:u=""})=>a.jsx("div",{className:`qwen-webui-container ${u}`,children:e});g.AgentToolCall=Kt,g.ArrowUpIcon=_u,g.AskUserQuestionDialog=ta,g.AssistantMessage=Ht,g.AutoEditIcon=Tu,g.Button=br,g.ChatHeader=$r,g.ChatViewer=gu,g.ChatViewerDefault=gu,g.CheckboxDisplay=nr,g.ChevronDownIcon=vu,g.CloseIcon=Ia,g.CloseSmallIcon=Cu,g.CloseXIcon=Pr,g.CodeBlock=ca,g.CodeBracketsIcon=Mu,g.CollapsibleFileContent=Lt,g.CompletionMenu=Fu,g.Container=Dr,g.ContextIndicator=Au,g.CopyButton=fu,g.EditPencilIcon=Ve,g.EditToolCall=Rt,g.EmptyState=jr,g.ExpandControlContext=Fe,g.FileIcon=Xo,g.FileLink=j,g.FileListIcon=Jo,g.FolderIcon=Ko,g.Footer=Sr,g.GenericToolCall=Jt,g.Header=Ar,g.HideContextIcon=Lu,g.Icon=Ta,g.ImageMessageRenderer=na,g.ImagePreview=ra,g.Input=xr,g.InputForm=Wr,g.InsightProgressCard=ua,g.InterruptedMessage=en,g.LinkIcon=Bu,g.LocationsList=Zt,g.Main=Nr,g.MarkdownRenderer=_e,g.Message=Xr,g.MessageContent=ie,g.MessageInput=Jr,g.MessageList=Qr,g.Onboarding=Gr,g.OpenDiffIcon=qr,g.PermissionDrawer=Sa,g.PlanCompletedIcon=Oo,g.PlanInProgressIcon=zo,g.PlanModeIcon=Iu,g.PlanPendingIcon=jo,g.PlatformContext=Ze,g.PlatformProvider=Cr,g.PlusIcon=wu,g.PlusSmallIcon=Lr,g.ReadToolCall=sr,g.RefreshIcon=Br,g.SaveDocumentIcon=Qo,g.SearchIcon=Eu,g.SearchToolCall=rr,g.SelectionIcon=Vo,g.SendIcon=Ma,g.SessionSelector=zr,g.ShellToolCall=cr,g.Sidebar=Fr,g.SlashCommandIcon=Pu,g.StatusIndicator=aa,g.StopIcon=$u,g.SymbolIcon=Zo,g.TerminalIcon=Ro,g.ThinkToolCall=Gt,g.ThinkingIcon=Yo,g.ThinkingMessage=jt,g.ToolCallCard=Ce,g.ToolCallContainer=O,g.ToolCallRow=W,g.Tooltip=Du,g.UndoIcon=Hr,g.UpdatedPlanToolCall=ar,g.UserIcon=Ho,g.UserMessage=Ot,g.WaitingMessage=Rr,g.WarningTriangleIcon=qo,g.WebFetchToolCall=ir,g.WebviewContainer=Ga,g.WriteToolCall=er,g.ZERO_WIDTH_SPACE=Vr,g.adaptACPMessages=Va,g.adaptJSONLMessages=Ha,g.extractCommandOutput=Ut,g.filterEmptyMessages=Za,g.formatValue=je,g.getEditModeIcon=Ur,g.getTimeAgo=Su,g.getToolCallComponent=dr,g.groupContent=G,g.groupSessionsByDate=Nu,g.handleCopyToClipboard=Vt,g.hasToolCallOutput=sa,g.isAgentExecutionRawOutput=Qt,g.isAgentExecutionToolCall=pu,g.isMessageData=Wa,g.isToolCallData=Ua,g.mapToolStatusToContainerStatus=Z,g.parseContentWithFileReferences=Mt,g.safeTitle=te,g.shouldShowToolCall=Wt,g.stripZeroWidthSpaces=Se,g.useControlledExpanded=ne,g.useExpandControl=Er,g.useFollowupSuggestions=za,g.useLocalStorage=Pa,g.usePlatform=re,g.useTheme=La,Object.defineProperty(g,Symbol.toStringTag,{value:"Module"})});;\n </script>\n <style>\n /**\n * @license\n * Copyright 2025 Qwen Team\n * SPDX-License-Identifier: Apache-2.0\n */*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }/*! tailwindcss v3.4.18 | MIT License | https://tailwindcss.com\n */*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:var(--app-font-sans, system-ui, sans-serif);font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--app-font-mono, ui-monospace, monospace);font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}.container{width:100%}@media (min-width: 640px){.container{max-width:640px}}@media (min-width: 768px){.container{max-width:768px}}@media (min-width: 1024px){.container{max-width:1024px}}@media (min-width: 1280px){.container{max-width:1280px}}@media (min-width: 1536px){.container{max-width:1536px}}.pointer-events-none{pointer-events:none}.pointer-events-auto{pointer-events:auto}.\\!visible{visibility:visible!important}.visible{visibility:visible}.invisible{visibility:hidden}.collapse{visibility:collapse}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.inset-0{top:0;right:0;bottom:0;left:0}.inset-x-0{left:0;right:0}.inset-x-4{left:1rem;right:1rem}.-right-2{right:-.5rem}.-top-2{top:-.5rem}.-top-7{top:-1.75rem}.bottom-0{bottom:0}.bottom-4{bottom:1rem}.bottom-full{bottom:100%}.left-0{left:0}.left-1\\/2{left:50%}.left-3{left:.75rem}.left-\\[3px\\]{left:3px}.left-full{left:100%}.right-0{right:0}.right-3{right:.75rem}.right-full{right:100%}.top-0{top:0}.top-1\\/2{top:50%}.top-\\[-0\\.1em\\]{top:-.1em}.top-\\[10px\\]{top:10px}.top-\\[3px\\]{top:3px}.top-full{top:100%}.z-50{z-index:50}.z-\\[1000\\]{z-index:1000}.z-\\[1\\]{z-index:1}.z-\\[999\\]{z-index:999}.col-start-3{grid-column-start:3}.row-span-2{grid-row:span 2 / span 2}.m-0{margin:0}.m-\\[2px\\]{margin:2px}.mx-1{margin-left:.25rem;margin-right:.25rem}.mx-auto{margin-left:auto;margin-right:auto}.my-1{margin-top:.25rem;margin-bottom:.25rem}.my-2{margin-top:.5rem;margin-bottom:.5rem}.mb-0\\.5{margin-bottom:.125rem}.mb-1{margin-bottom:.25rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.mb-\\[2px\\]{margin-bottom:2px}.ml-2{margin-left:.5rem}.ml-4{margin-left:1rem}.ml-8{margin-left:2rem}.ml-auto{margin-left:auto}.mr-1\\.5{margin-right:.375rem}.mt-1{margin-top:.25rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.mt-\\[2px\\]{margin-top:2px}.box-border{box-sizing:border-box}.\\!block{display:block!important}.block{display:block}.inline-block{display:inline-block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.grid{display:grid}.contents{display:contents}.hidden{display:none}.h-1{height:.25rem}.h-1\\.5{height:.375rem}.h-14{height:3.5rem}.h-2{height:.5rem}.h-4{height:1rem}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-\\[60px\\]{height:60px}.h-\\[80px\\]{height:80px}.h-full{height:100%}.max-h-\\[100px\\]{max-height:100px}.max-h-\\[300px\\]{max-height:300px}.max-h-\\[40vh\\]{max-height:40vh}.max-h-\\[50vh\\]{max-height:50vh}.max-h-\\[60vh\\]{max-height:60vh}.max-h-\\[min\\(500px\\,50vh\\)\\]{max-height:min(500px,50vh)}.min-h-0{min-height:0px}.min-h-6{min-height:1.5rem}.w-1\\.5{width:.375rem}.w-14{width:3.5rem}.w-2{width:.5rem}.w-2\\.5{width:.625rem}.w-4{width:1rem}.w-5{width:1.25rem}.w-6{width:1.5rem}.w-\\[60px\\]{width:60px}.w-\\[80px\\]{width:80px}.w-\\[min\\(400px\\,calc\\(100vw-32px\\)\\)\\]{width:min(400px,calc(100vw - 32px))}.w-full{width:100%}.min-w-0{min-width:0px}.min-w-\\[10px\\]{min-width:10px}.min-w-\\[18px\\]{min-width:18px}.max-w-\\[300px\\]{max-width:300px}.max-w-\\[400px\\]{max-width:400px}.max-w-\\[50\\%\\]{max-width:50%}.max-w-full{max-width:100%}.max-w-md{max-width:28rem}.max-w-sm{max-width:24rem}.max-w-xs{max-width:20rem}.flex-1{flex:1 1 0%}.flex-shrink-0,.shrink-0{flex-shrink:0}.grow{flex-grow:1}.-translate-x-1\\/2{--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-x-full{--tw-translate-x: -100%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-y-1{--tw-translate-y: -.25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-y-1\\/2{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-0{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-1\\/2{--tw-translate-x: 50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-1{--tw-translate-y: .25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-1\\/2{--tw-translate-y: 50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-\\[-50\\%\\]{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-rotate-45{--tw-rotate: -45deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.animate-\\[fadeIn_0\\.2s_ease-in\\]{animation:fadeIn .2s ease-in}@keyframes completion-menu-enter{0%{opacity:0;transform:translateY(4px)}to{opacity:1;transform:translateY(0)}}.animate-completion-menu-enter{animation:completion-menu-enter .15s ease-out both}@keyframes slide-up{0%{transform:translateY(100%);opacity:0}to{transform:translateY(0);opacity:1}}.animate-slide-up{animation:slide-up .2s ease-out both}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-default{cursor:default}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.select-text{-webkit-user-select:text;-moz-user-select:text;user-select:text}.resize{resize:both}.list-none{list-style-type:none}.appearance-none{-webkit-appearance:none;-moz-appearance:none;appearance:none}.grid-cols-\\[80px_1fr\\]{grid-template-columns:80px 1fr}.grid-cols-\\[auto_1fr\\]{grid-template-columns:auto 1fr}.grid-cols-\\[max-content_1fr\\]{grid-template-columns:max-content 1fr}.grid-cols-\\[minmax\\(0\\,1fr\\)_auto\\]{grid-template-columns:minmax(0,1fr) auto}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-center{align-items:center}.items-baseline{align-items:baseline}.justify-start{justify-content:flex-start}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-0{gap:0px}.gap-0\\.5{gap:.125rem}.gap-1{gap:.25rem}.gap-1\\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-6{gap:1.5rem}.gap-8{gap:2rem}.gap-\\[2px\\]{gap:2px}.gap-\\[3px\\]{gap:3px}.gap-\\[var\\(--app-list-gap\\)\\]{gap:var(--app-list-gap)}.gap-x-4{-moz-column-gap:1rem;column-gap:1rem}.gap-y-1{row-gap:.25rem}.self-center{align-self:center}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.overflow-y-hidden{overflow-y:hidden}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.text-ellipsis{text-overflow:ellipsis}.whitespace-normal{white-space:normal}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.rounded{border-radius:.25rem}.rounded-\\[2px\\]{border-radius:2px}.rounded-\\[4px\\]{border-radius:4px}.rounded-\\[5px\\]{border-radius:5px}.rounded-\\[var\\(--app-list-border-radius\\)\\]{border-radius:var(--app-list-border-radius)}.rounded-\\[var\\(--corner-radius-small\\)\\]{border-radius:var(--corner-radius-small)}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.rounded-sm{border-radius:.125rem}.border{border-width:1px}.border-0{border-width:0px}.border-2{border-width:2px}.border-\\[0\\.5px\\]{border-width:.5px}.border-b{border-bottom-width:1px}.border-b-2{border-bottom-width:2px}.border-l{border-left-width:1px}.border-l-2{border-left-width:2px}.border-t{border-top-width:1px}.border-none{border-style:none}.border-\\[\\#74c991\\]{--tw-border-opacity: 1;border-color:rgb(116 201 145 / var(--tw-border-opacity, 1))}.border-\\[var\\(--app-input-border\\)\\]{border-color:var(--app-input-border)}.border-\\[var\\(--app-input-border\\,\\#374151\\)\\]{border-color:var(--app-input-border,#374151)}.border-\\[var\\(--app-primary-border-color\\)\\]{border-color:var(--app-primary-border-color)}.border-\\[var\\(--vscode-focusBorder\\)\\]{border-color:var(--vscode-focusBorder)}.border-\\[var\\(--vscode-inputValidation-errorBorder\\,\\#be1100\\)\\]{border-color:var(--vscode-inputValidation-errorBorder,#be1100)}.border-gray-300{--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity, 1))}.border-gray-500{--tw-border-opacity: 1;border-color:rgb(107 114 128 / var(--tw-border-opacity, 1))}.border-gray-600{--tw-border-opacity: 1;border-color:rgb(75 85 99 / var(--tw-border-opacity, 1))}.border-red-500{--tw-border-opacity: 1;border-color:rgb(239 68 68 / var(--tw-border-opacity, 1))}.border-transparent{border-color:transparent}.bg-\\[\\#2196f3\\]{--tw-bg-opacity: 1;background-color:rgb(33 150 243 / var(--tw-bg-opacity, 1))}.bg-\\[\\#4caf50\\]{--tw-bg-opacity: 1;background-color:rgb(76 175 80 / var(--tw-bg-opacity, 1))}.bg-\\[\\#f44336\\]{--tw-bg-opacity: 1;background-color:rgb(244 67 54 / var(--tw-bg-opacity, 1))}.bg-\\[\\#ffc107\\]{--tw-bg-opacity: 1;background-color:rgb(255 193 7 / var(--tw-bg-opacity, 1))}.bg-\\[var\\(--app-background\\)\\]{background-color:var(--app-background)}.bg-\\[var\\(--app-button-background\\)\\]{background-color:var(--app-button-background)}.bg-\\[var\\(--app-button-secondary-background\\)\\]{background-color:var(--app-button-secondary-background)}.bg-\\[var\\(--app-header-background\\)\\]{background-color:var(--app-header-background)}.bg-\\[var\\(--app-input-background\\)\\]{background-color:var(--app-input-background)}.bg-\\[var\\(--app-list-active-background\\)\\]{background-color:var(--app-list-active-background)}.bg-\\[var\\(--app-menu-background\\)\\]{background-color:var(--app-menu-background)}.bg-\\[var\\(--app-primary\\,var\\(--app-button-background\\)\\)\\]{background-color:var(--app-primary,var(--app-button-background))}.bg-\\[var\\(--app-primary-background\\)\\]{background-color:var(--app-primary-background)}.bg-\\[var\\(--app-primary-background\\,\\#1f2937\\)\\]{background-color:var(--app-primary-background,#1f2937)}.bg-\\[var\\(--app-tool-background\\)\\]{background-color:var(--app-tool-background)}.bg-\\[var\\(--vscode-input-background\\,var\\(--app-input-background\\)\\)\\]{background-color:var(--vscode-input-background,var(--app-input-background))}.bg-\\[var\\(--vscode-inputValidation-errorBackground\\,\\#5a1d1d\\)\\]{background-color:var(--vscode-inputValidation-errorBackground,#5a1d1d)}.bg-blue-500{--tw-bg-opacity: 1;background-color:rgb(59 130 246 / var(--tw-bg-opacity, 1))}.bg-blue-600{--tw-bg-opacity: 1;background-color:rgb(37 99 235 / var(--tw-bg-opacity, 1))}.bg-gray-100{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.bg-gray-200{--tw-bg-opacity: 1;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1))}.bg-gray-500{--tw-bg-opacity: 1;background-color:rgb(107 114 128 / var(--tw-bg-opacity, 1))}.bg-gray-700{--tw-bg-opacity: 1;background-color:rgb(55 65 81 / var(--tw-bg-opacity, 1))}.bg-red-600{--tw-bg-opacity: 1;background-color:rgb(220 38 38 / var(--tw-bg-opacity, 1))}.bg-transparent{background-color:transparent}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.bg-gradient-to-b{background-image:linear-gradient(to bottom,var(--tw-gradient-stops))}.from-transparent{--tw-gradient-from: transparent var(--tw-gradient-from-position);--tw-gradient-to: rgb(0 0 0 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.to-\\[var\\(--app-primary-background\\)\\]{--tw-gradient-to: var(--app-primary-background) var(--tw-gradient-to-position)}.object-contain{-o-object-fit:contain;object-fit:contain}.object-cover{-o-object-fit:cover;object-fit:cover}.p-0{padding:0}.p-0\\.5{padding:.125rem}.p-1{padding:.25rem}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-5{padding:1.25rem}.p-\\[var\\(--app-list-item-padding\\)\\]{padding:var(--app-list-item-padding)}.p-\\[var\\(--app-list-padding\\)\\]{padding:var(--app-list-padding)}.px-1\\.5{padding-left:.375rem;padding-right:.375rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-2\\.5{padding-left:.625rem;padding-right:.625rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.px-\\[30px\\]{padding-left:30px;padding-right:30px}.py-0{padding-top:0;padding-bottom:0}.py-0\\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\\.5{padding-top:.375rem;padding-bottom:.375rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.pb-1{padding-bottom:.25rem}.pb-2{padding-bottom:.5rem}.pb-4{padding-bottom:1rem}.pl-1{padding-left:.25rem}.pl-10{padding-left:2.5rem}.pl-\\[30px\\]{padding-left:30px}.pr-10{padding-right:2.5rem}.pr-2{padding-right:.5rem}.pt-1{padding-top:.25rem}.pt-\\[2px\\]{padding-top:2px}.text-left{text-align:left}.text-center{text-align:center}.align-middle{vertical-align:middle}.font-mono{font-family:var(--app-font-mono, ui-monospace, monospace)}.text-2xl{font-size:1.5rem;line-height:2rem}.text-\\[0\\.75em\\]{font-size:.75em}.text-\\[0\\.85em\\]{font-size:.85em}.text-\\[0\\.8em\\]{font-size:.8em}.text-\\[0\\.9em\\]{font-size:.9em}.text-\\[1\\.1em\\]{font-size:1.1em}.text-\\[11px\\]{font-size:11px}.text-\\[12px\\]{font-size:12px}.text-\\[13px\\]{font-size:13px}.text-\\[14px\\]{font-size:14px}.text-\\[15px\\]{font-size:15px}.text-\\[16px\\]{font-size:16px}.text-\\[1em\\]{font-size:1em}.text-\\[8px\\]{font-size:8px}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xs{font-size:.75rem;line-height:1rem}.font-\\[600\\]{font-weight:600}.font-\\[var\\(--vscode-chat-font-family\\)\\]{font-weight:var(--vscode-chat-font-family)}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.capitalize{text-transform:capitalize}.italic{font-style:italic}.tabular-nums{--tw-numeric-spacing: tabular-nums;font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)}.leading-5{line-height:1.25rem}.leading-6{line-height:1.5rem}.leading-\\[1\\.5\\]{line-height:1.5}.leading-none{line-height:1}.leading-normal{line-height:1.5}.leading-relaxed{line-height:1.625}.leading-tight{line-height:1.25}.tracking-wider{letter-spacing:.05em}.text-\\[\\#74c991\\]{--tw-text-opacity: 1;color:rgb(116 201 145 / var(--tw-text-opacity, 1))}.text-\\[\\#c74e39\\]{--tw-text-opacity: 1;color:rgb(199 78 57 / var(--tw-text-opacity, 1))}.text-\\[\\#e1c08d\\]{--tw-text-opacity: 1;color:rgb(225 192 141 / var(--tw-text-opacity, 1))}.text-\\[var\\(--app-button-foreground\\)\\]{color:var(--app-button-foreground)}.text-\\[var\\(--app-button-foreground\\,\\#ffffff\\)\\]{color:var(--app-button-foreground,#ffffff)}.text-\\[var\\(--app-list-active-foreground\\)\\]{color:var(--app-list-active-foreground)}.text-\\[var\\(--app-menu-foreground\\)\\]{color:var(--app-menu-foreground)}.text-\\[var\\(--app-monospace-font-size\\)\\]{color:var(--app-monospace-font-size)}.text-\\[var\\(--app-primary-foreground\\)\\]{color:var(--app-primary-foreground)}.text-\\[var\\(--app-primary-foreground\\,\\#f9fafb\\)\\]{color:var(--app-primary-foreground,#f9fafb)}.text-\\[var\\(--app-secondary-foreground\\)\\]{color:var(--app-secondary-foreground)}.text-\\[var\\(--vscode-chat-font-size\\,13px\\)\\]{color:var(--vscode-chat-font-size,13px)}.text-\\[var\\(--vscode-descriptionForeground\\)\\]{color:var(--vscode-descriptionForeground)}.text-\\[var\\(--vscode-errorForeground\\,\\#f48771\\)\\]{color:var(--vscode-errorForeground,#f48771)}.text-\\[var\\(--vscode-foreground\\)\\]{color:var(--vscode-foreground)}.text-\\[var\\(--vscode-input-foreground\\,var\\(--app-primary-foreground\\)\\)\\]{color:var(--vscode-input-foreground,var(--app-primary-foreground))}.text-\\[var\\(--vscode-symbolIcon-fileForeground\\,\\#cccccc\\)\\]{color:var(--vscode-symbolIcon-fileForeground,#cccccc)}.text-app-primary-foreground{color:var(--app-primary-foreground, #ffffff)}.text-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.text-gray-700{--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.text-gray-800{--tw-text-opacity: 1;color:rgb(31 41 55 / var(--tw-text-opacity, 1))}.text-green-500{--tw-text-opacity: 1;color:rgb(34 197 94 / var(--tw-text-opacity, 1))}.text-red-600{--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.line-through{text-decoration-line:line-through}.no-underline{text-decoration-line:none}.opacity-0{opacity:0}.opacity-100{opacity:1}.opacity-25{opacity:.25}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.opacity-70{opacity:.7}.opacity-75{opacity:.75}.opacity-85{opacity:.85}.opacity-90{opacity:.9}.shadow-\\[0_0_0_1px_var\\(--vscode-focusBorder\\)\\]{--tw-shadow: 0 0 0 1px var(--vscode-focusBorder);--tw-shadow-colored: 0 0 0 1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-\\[0_4px_16px_rgba\\(0\\,0\\,0\\,0\\.1\\)\\]{--tw-shadow: 0 4px 16px rgba(0,0,0,.1);--tw-shadow-colored: 0 4px 16px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-\\[inset_0_0_0_1px_var\\(--app-transparent-inner-border\\)\\]{--tw-shadow: inset 0 0 0 1px var(--app-transparent-inner-border);--tw-shadow-colored: inset 0 0 0 1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}.outline{outline-style:solid}.ring{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-100{transition-duration:.1s}.duration-150{transition-duration:.15s}.duration-200{transition-duration:.2s}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}.ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}.\\[scrollbar-width\\:thin\\]{scrollbar-width:thin}:root{--app-primary: #3b82f6;--app-primary-hover: #2563eb;--app-primary-foreground: #e4e4e7;--app-secondary-foreground: #a1a1aa;--app-background: #1e1e1e;--app-primary-background: #1e1e1e;--app-background-secondary: #252526;--app-secondary-background: #252526;--app-background-tertiary: #2d2d2d;--app-foreground: #e4e4e7;--app-foreground-secondary: #a1a1aa;--app-foreground-muted: #71717a;--app-border: #3f3f46;--app-border-focus: #3b82f6;--app-primary-border-color: #3f3f46;--app-success: #10b981;--app-warning: #f59e0b;--app-error: #ef4444;--app-info: #3b82f6;--app-font-sans: system-ui, -apple-system, sans-serif;--app-font-mono: var( --app-monospace-font-family, ui-monospace, "SF Mono", monospace );--app-monospace-font-size: 13px;--font-size-xs: 11px;--app-link-foreground: #007acc;--app-link-active-foreground: #005a9e;--app-qwen-ivory: #f5f5dc;--app-radius-sm: .25rem;--app-radius-md: .375rem;--app-radius-lg: .5rem;--qwen-corner-radius-small: 6px;--qwen-corner-radius-medium: 8px;--corner-radius-small: var(--app-radius-sm, 4px);--corner-radius-medium: var(--app-radius-md, 6px);--border-radius-medium: var(--corner-radius-medium, 6px);--app-spacing-xs: .25rem;--app-spacing-sm: .5rem;--app-spacing-md: 1rem;--app-spacing-medium: 8px;--app-spacing-lg: 1.5rem;--app-spacing-xl: 2rem;--spacing-medium: var(--app-spacing-medium, 8px);--spacing-large: 12px;--app-input-background: #3c3c3c;--app-input-secondary-background: #2d2d2d;--app-input-border: #3f3f46;--app-input-foreground: #e4e4e7;--app-input-placeholder-foreground: #71717a;--app-ghost-button-hover-background: rgba(90, 93, 94, .31);--app-button-background: #3c3c3c;--app-button-foreground: #ffffff;--app-button-hover-background: var(--app-primary-hover);--app-transparent-inner-border: rgba(255, 255, 255, .1);--app-header-background: #252526;--app-list-padding: 0px;--app-list-item-padding: 4px 8px;--app-list-border-color: transparent;--app-list-border-radius: 4px;--app-list-hover-background: rgba(90, 93, 94, .31);--app-list-active-background: #094771;--app-list-active-foreground: #ffffff;--app-list-gap: 2px;--app-menu-background: #252526;--app-menu-border: #454545;--app-menu-foreground: #cccccc;--app-menu-selection-background: #094771;--app-menu-selection-foreground: #ffffff;--app-tool-background: #1e1e1e;--app-code-background: #2d2d2d;--app-warning-background: rgba(255, 204, 0, .1);--app-warning-border: #ffcc00;--app-warning-foreground: #ffcc00;--vscode-chat-font-size: 13px;--vscode-chat-font-family: var(--app-font-sans);--vscode-focusBorder: var(--app-border-focus);--vscode-symbolIcon-fileForeground: var(--app-secondary-foreground)}@media (prefers-color-scheme: light){:root.auto-theme{--app-primary-foreground: #1f2937;--app-secondary-foreground: #6b7280;--app-background: #ffffff;--app-primary-background: #ffffff;--app-background-secondary: #f3f4f6;--app-background-tertiary: #e5e7eb;--app-foreground: #1f2937;--app-foreground-secondary: #6b7280;--app-foreground-muted: #9ca3af;--app-border: #e5e7eb;--app-primary-border-color: #e5e7eb;--app-input-background: #ffffff;--app-input-border: #d1d5db;--app-input-placeholder-foreground: #9ca3af;--app-ghost-button-hover-background: rgba(0, 0, 0, .05);--app-header-background: #f9fafb;--app-list-hover-background: rgba(0, 0, 0, .05);--app-list-active-background: #3b82f6;--app-menu-background: #ffffff;--app-menu-border: #e5e7eb;--app-menu-foreground: #1f2937;--app-tool-background: #ffffff;--app-code-background: #f3f4f6}}.placeholder\\:text-\\[var\\(--app-input-placeholder-foreground\\)\\]::-moz-placeholder{color:var(--app-input-placeholder-foreground)}.placeholder\\:text-\\[var\\(--app-input-placeholder-foreground\\)\\]::placeholder{color:var(--app-input-placeholder-foreground)}.placeholder\\:opacity-60::-moz-placeholder{opacity:.6}.placeholder\\:opacity-60::placeholder{opacity:.6}.focus-within\\:opacity-100:focus-within{opacity:1}.hover\\:relative:hover{position:relative}.hover\\:border-0:hover{border-width:0px}.hover\\:bg-\\[var\\(--app-button-background\\)\\]:hover{background-color:var(--app-button-background)}.hover\\:bg-\\[var\\(--app-code-background\\)\\]:hover{background-color:var(--app-code-background)}.hover\\:bg-\\[var\\(--app-ghost-button-hover-background\\)\\]:hover{background-color:var(--app-ghost-button-hover-background)}.hover\\:bg-\\[var\\(--app-input-background\\)\\]:hover{background-color:var(--app-input-background)}.hover\\:bg-\\[var\\(--app-input-border\\)\\]:hover{background-color:var(--app-input-border)}.hover\\:bg-\\[var\\(--app-list-active-background\\)\\]:hover{background-color:var(--app-list-active-background)}.hover\\:bg-\\[var\\(--app-list-hover-background\\)\\]:hover{background-color:var(--app-list-hover-background)}.hover\\:bg-\\[var\\(--app-primary-hover\\,var\\(--app-button-hover-background\\)\\)\\]:hover{background-color:var(--app-primary-hover,var(--app-button-hover-background))}.hover\\:bg-black\\/5:hover{background-color:#0000000d}.hover\\:bg-blue-700:hover{--tw-bg-opacity: 1;background-color:rgb(29 78 216 / var(--tw-bg-opacity, 1))}.hover\\:bg-gray-100:hover{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.hover\\:bg-gray-300:hover{--tw-bg-opacity: 1;background-color:rgb(209 213 219 / var(--tw-bg-opacity, 1))}.hover\\:bg-gray-50:hover{--tw-bg-opacity: 1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1))}.hover\\:bg-gray-800:hover{--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity, 1))}.hover\\:bg-red-700:hover{--tw-bg-opacity: 1;background-color:rgb(185 28 28 / var(--tw-bg-opacity, 1))}.hover\\:font-bold:hover{font-weight:700}.hover\\:text-\\[var\\(--app-button-foreground\\)\\]:hover{color:var(--app-button-foreground)}.hover\\:text-\\[var\\(--app-list-active-foreground\\)\\]:hover{color:var(--app-list-active-foreground)}.hover\\:text-\\[var\\(--app-primary-foreground\\)\\]:hover{color:var(--app-primary-foreground)}.hover\\:underline:hover{text-decoration-line:underline}.hover\\:\\!opacity-100:hover{opacity:1!important}.hover\\:opacity-100:hover{opacity:1}.hover\\:opacity-80:hover{opacity:.8}.focus\\:rounded-\\[2px\\]:focus{border-radius:2px}.focus\\:border-blue-500:focus{--tw-border-opacity: 1;border-color:rgb(59 130 246 / var(--tw-border-opacity, 1))}.focus\\:border-red-500:focus{--tw-border-opacity: 1;border-color:rgb(239 68 68 / var(--tw-border-opacity, 1))}.focus\\:bg-\\[var\\(--app-ghost-button-hover-background\\)\\]:focus{background-color:var(--app-ghost-button-hover-background)}.focus\\:opacity-100:focus{opacity:1}.focus\\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\\:outline:focus{outline-style:solid}.focus\\:outline-1:focus{outline-width:1px}.focus\\:outline-offset-2:focus{outline-offset:2px}.focus\\:outline-\\[var\\(--vscode-focusBorder\\)\\]:focus{outline-color:var(--vscode-focusBorder)}.focus\\:ring-1:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\\:ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\\:ring-blue-500:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(59 130 246 / var(--tw-ring-opacity, 1))}.focus\\:ring-gray-400:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(156 163 175 / var(--tw-ring-opacity, 1))}.focus\\:ring-gray-500:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(107 114 128 / var(--tw-ring-opacity, 1))}.focus\\:ring-red-500:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(239 68 68 / var(--tw-ring-opacity, 1))}.focus\\:ring-offset-2:focus{--tw-ring-offset-width: 2px}.active\\:scale-95:active{--tw-scale-x: .95;--tw-scale-y: .95;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.active\\:opacity-80:active{opacity:.8}.disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:opacity-30:disabled{opacity:.3}.group:hover .group-hover\\:flex{display:flex}.group:hover .group-hover\\:opacity-100{opacity:1}.group:hover .group-hover\\:opacity-70{opacity:.7}@media (min-width: 640px){.sm\\:inline{display:inline}}@media (min-width: 768px){.md\\:max-w-md{max-width:28rem}.md\\:p-10{padding:2.5rem}}@media (min-width: 1024px){.lg\\:max-w-lg{max-width:32rem}}@media (prefers-color-scheme: dark){.dark\\:border-gray-600{--tw-border-opacity: 1;border-color:rgb(75 85 99 / var(--tw-border-opacity, 1))}.dark\\:bg-gray-600{--tw-bg-opacity: 1;background-color:rgb(75 85 99 / var(--tw-bg-opacity, 1))}.dark\\:opacity-60{opacity:.6}.dark\\:hover\\:bg-gray-500:hover{--tw-bg-opacity: 1;background-color:rgb(107 114 128 / var(--tw-bg-opacity, 1))}}.\\[\\&\\:\\:-webkit-scrollbar-thumb\\]\\:rounded-full::-webkit-scrollbar-thumb{border-radius:9999px}.\\[\\&\\:\\:-webkit-scrollbar-track\\]\\:bg-transparent::-webkit-scrollbar-track{background-color:transparent}.\\[\\&\\:\\:-webkit-scrollbar\\]\\:w-1\\.5::-webkit-scrollbar{width:.375rem}.\\[\\&\\:not\\(\\:first-child\\)\\]\\:mt-2:not(:first-child){margin-top:.5rem}.\\[\\&\\>svg\\]\\:h-5>svg{height:1.25rem}.\\[\\&\\>svg\\]\\:w-5>svg{width:1.25rem}/**\n * @license\n * Copyright 2025 Qwen Team\n * SPDX-License-Identifier: Apache-2.0\n *\n * Shared timeline styles - base classes only\n * Individual component styles are in their respective CSS files:\n * - LayoutComponents.css (tool calls)\n * - AssistantMessage.css (assistant messages)\n * \n * Timeline connectors are inferred from DOM order; data-first/data-last can override\n */.message-item{width:100%;align-items:flex-start;padding:8px 0 8px 30px;-webkit-user-select:text;-moz-user-select:text;user-select:text;position:relative}.user-message-container{margin-top:16px}.user-message-container:first-child{margin-top:0}.qwen-message.message-item:not(.user-message-container):first-child:after,.user-message-container+.qwen-message.message-item:not(.user-message-container):after,.chat-messages>:not(.qwen-message.message-item)+.qwen-message.message-item:not(.user-message-container):after,.chat-viewer-messages>:not(.qwen-message.message-item)+.qwen-message.message-item:not(.user-message-container):after{top:var(--timeline-center-offset, 13px)}.qwen-message.message-item:not(.user-message-container):has(+.user-message-container):after,.qwen-message.message-item:not(.user-message-container):has(+:not(.qwen-message.message-item)):after,.qwen-message.message-item:not(.user-message-container):last-child:after{bottom:calc(100% - var(--timeline-center-offset, 13px))}.qwen-message.message-item[data-first=true]:after{top:var(--timeline-center-offset, 13px)}.qwen-message.message-item[data-last=true]:after{bottom:calc(100% - var(--timeline-center-offset, 13px))}.qwen-message.message-item[data-first=true][data-last=true]:after{display:none}/**\n * @license\n * Copyright 2025 Qwen Team\n * SPDX-License-Identifier: Apache-2.0\n *\n * Common component styles for webui\n * These styles are shared across all platforms (vscode, web, etc.)\n */.webui-root *{margin:0;padding:0;box-sizing:border-box}@keyframes fadeIn{0%{opacity:0;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}@keyframes pulse{0%,to{opacity:1}50%{opacity:.3}}@keyframes typingPulse{0%,60%,to{transform:scale(.7);opacity:.6}30%{transform:scale(1);opacity:1}}.chat-container{display:flex;flex-direction:column;height:100%;width:100%;background-color:var(--app-primary-background);color:var(--app-primary-foreground);font-family:var(--vscode-chat-font-family, var(--app-font-sans));font-size:var(--vscode-chat-font-size, 13px)}.chat-messages{flex:1;overflow-y:auto;overflow-x:hidden;padding:20px;display:flex;flex-direction:column;position:relative;min-width:0;scroll-behavior:smooth}.chat-messages>*{overflow-anchor:none}.input-form{display:flex;background-color:var(--app-primary-background);border-top:1px solid var(--app-primary-border-color)}.input-field{flex:1;padding:10px 12px;background-color:var(--app-input-background);color:var(--app-input-foreground);border:1px solid var(--app-input-border);border-radius:var(--app-radius-sm, 4px);font-size:var(--vscode-chat-font-size, 13px);font-family:var(--vscode-chat-font-family, var(--app-font-sans));outline:none;line-height:1.5}.input-field:focus{border-color:var(--app-primary, #3b82f6)}.input-field:disabled{opacity:.5;cursor:not-allowed}.input-field::-moz-placeholder{color:var(--app-input-placeholder-foreground)}.input-field::placeholder{color:var(--app-input-placeholder-foreground)}.send-button{padding:10px 20px;background-color:var(--app-primary, #3b82f6);color:var(--app-button-foreground, white);border:none;border-radius:var(--app-radius-sm, 4px);font-size:var(--vscode-chat-font-size, 13px);font-weight:500;cursor:pointer;transition:filter .15s ease;display:flex;align-items:center;justify-content:center}.send-button:hover:not(:disabled){filter:brightness(1.1)}.send-button:active:not(:disabled){filter:brightness(.9)}.send-button:disabled{opacity:.5;cursor:not-allowed}.code-block{font-family:var(--app-font-mono);font-size:var(--app-monospace-font-size, 13px);background:var(--app-primary-background);border:1px solid var(--app-input-border);border-radius:var(--app-radius-sm, 4px);padding:var(--app-spacing-medium, 8px);overflow-x:auto;margin:4px 0 0;white-space:pre-wrap;word-break:break-word;max-height:300px;overflow-y:auto}.diff-display-container{margin:8px 0;border:1px solid var(--app-input-border);border-radius:var(--app-radius-md, 6px);overflow:hidden}.diff-header{display:flex;align-items:center;justify-content:space-between;padding:8px 12px;background:var( --app-input-secondary-background, var(--app-background-secondary) );border-bottom:1px solid var(--app-input-border)}.diff-file-path{font-family:var(--app-font-mono);font-size:13px;color:var(--app-primary-foreground)}.open-diff-button{display:flex;align-items:center;gap:6px;padding:4px 8px;background:transparent;border:1px solid var(--app-input-border);border-radius:var(--app-radius-sm, 4px);color:var(--app-primary-foreground);cursor:pointer;font-size:12px;transition:background-color .15s}.open-diff-button:hover{background:var(--app-ghost-button-hover-background)}.open-diff-button svg{width:16px;height:16px}.diff-section{margin:0}.diff-label{padding:8px 12px;background:var(--app-primary-background);border-bottom:1px solid var(--app-input-border);font-size:11px;font-weight:600;color:var(--app-secondary-foreground);text-transform:uppercase}.diff-section .code-block{border:none;border-radius:0;margin:0;max-height:none;overflow-y:visible}.diff-section .code-content{display:block}.toolcall-card{padding-left:30px}.btn-ghost{background:transparent;border:1px solid transparent;border-radius:4px;cursor:pointer;outline:none;transition:background-color .2s;color:var(--app-primary-foreground);font-size:var(--vscode-chat-font-size, 13px)}.btn-ghost:hover,.btn-ghost:focus{background:var(--app-ghost-button-hover-background)}.btn-icon-compact{display:inline-flex;align-items:center;justify-content:center;width:26px;height:26px;padding:0;border-radius:var(--app-radius-sm, 4px);background:transparent;border:1px solid transparent;cursor:pointer;flex-shrink:0;transition:all .15s;color:var(--app-secondary-foreground)}.btn-icon-compact:hover{background-color:var(--app-ghost-button-hover-background)}.btn-icon-compact svg{width:16px;height:16px}.btn-icon-compact--active{background-color:var(--app-primary, #3b82f6);color:#fff}.btn-text-compact{display:inline-flex;align-items:center;gap:4px;padding:2px 4px;border-radius:2px;cursor:pointer;background:transparent;border:0;min-width:0;flex-shrink:1;font-size:.85em;transition:background-color .15s;color:var(--app-secondary-foreground)}.btn-text-compact:hover{background-color:var(--app-ghost-button-hover-background)}.btn-text-compact>svg{height:1em;width:1em;flex-shrink:0}.btn-text-compact>span{display:inline-block;min-width:0;max-width:200px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;vertical-align:middle}.context-indicator{display:inline-flex;align-items:center;gap:4px;padding:2px 4px;border-radius:var(--app-radius-sm, 4px);font-size:.8em;-webkit-user-select:none;-moz-user-select:none;user-select:none;color:var(--app-secondary-foreground)}.context-indicator svg{width:20px;height:20px}.context-indicator__track,.context-indicator__progress{fill:none;stroke-width:2.5}.context-indicator__track{stroke:var(--app-secondary-foreground);opacity:.35}.context-indicator__progress{stroke:var(--app-secondary-foreground);stroke-linecap:round}.composer-root{position:absolute;bottom:16px;left:16px;right:16px;display:flex;flex-direction:column;z-index:20}.composer-form{position:relative;display:flex;flex-direction:column;max-width:680px;margin:0 auto;border-radius:var(--app-radius-lg, 8px);border:1px solid var(--app-input-border);box-shadow:0 1px 3px #0000001a;transition:border-color .2s;z-index:1;background:var( --app-input-secondary-background, var(--app-background-secondary) );color:var(--app-input-foreground)}.composer-form:focus-within{border-color:var(--app-primary, #3b82f6);box-shadow:0 1px 2px #3b82f633}.composer-input{flex:1;align-self:stretch;padding:10px 14px;outline:none;overflow-y:auto;position:relative;-webkit-user-select:text;-moz-user-select:text;user-select:text;min-height:1.5em;max-height:200px;background:transparent;border:0;border-radius:0;overflow-x:hidden;word-break:break-word;white-space:pre-wrap;font-family:inherit;font-size:var(--vscode-chat-font-size, 13px);color:var(--app-input-foreground)}.composer-input:empty:before,.composer-input[data-empty=true]:before{content:attr(data-placeholder);color:var(--app-input-placeholder-foreground);pointer-events:none;position:absolute;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:calc(100% - 28px)}.composer-input[data-has-suggestion=true]:empty:before,.composer-input[data-has-suggestion=true][data-empty=true]:before{color:var(--app-primary, #3b82f6);opacity:.7;font-style:italic}.composer-input[data-has-suggestion=true]:hover:empty:before,.composer-input[data-has-suggestion=true]:hover[data-empty=true]:before{opacity:.9;text-decoration:underline;text-decoration-style:dotted;text-underline-offset:2px}.composer-input:focus{outline:none}.composer-input:disabled,.composer-input[contenteditable=false]{color:#999;cursor:not-allowed}.composer-actions{display:flex;align-items:center;gap:4px;min-width:0;z-index:1;padding:5px;color:var(--app-secondary-foreground);border-top:.5px solid var(--app-input-border)}.composer-overlay{position:absolute;top:0;right:0;bottom:0;left:0;border-radius:var(--app-radius-lg, 8px);z-index:0;background:var(--app-input-background)}.btn-send-compact{display:inline-flex;align-items:center;justify-content:center;width:26px;height:26px;margin-left:auto;border-radius:var(--app-radius-sm, 4px);background-color:var(--app-primary, #3b82f6);color:#fff;border:none;cursor:pointer}.btn-send-compact:hover:not(:disabled){filter:brightness(1.1)}.btn-send-compact:disabled{opacity:.4;cursor:not-allowed}.toolcall-content-wrapper .file-link-path{font-size:.85em;padding-top:1px;word-break:break-all;min-width:0;font-family:var(--app-font-mono);overflow-wrap:anywhere}.icon-svg{display:block}.line-clamp-3{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3;overflow:hidden}/**\n * @license\n * Copyright 2025 Qwen Team\n * SPDX-License-Identifier: Apache-2.0\n *\n * Styles for MarkdownRenderer component\n */.markdown-content{line-height:1.6;color:var(--app-primary-foreground)}.markdown-content h1,.markdown-content h2,.markdown-content h3,.markdown-content h4,.markdown-content h5,.markdown-content h6{margin-top:1.5em;margin-bottom:.5em;font-weight:600}.markdown-content h1{font-size:1.75em;border-bottom:1px solid var(--app-primary-border-color);padding-bottom:.3em}.markdown-content h2{font-size:1.5em;border-bottom:1px solid var(--app-primary-border-color);padding-bottom:.3em}.markdown-content h3{font-size:1.25em}.markdown-content h4{font-size:1.1em}.markdown-content h5,.markdown-content h6{font-size:1em}.markdown-content p{margin-top:0}.markdown-content ul,.markdown-content ol{margin-top:1em;margin-bottom:1em;padding-left:2em}.markdown-content ul{list-style-type:disc;list-style-position:outside}.markdown-content ol{list-style-type:decimal;list-style-position:outside}.markdown-content ul ul{list-style-type:circle}.markdown-content ul ul ul{list-style-type:square}.markdown-content ol ol{list-style-type:lower-alpha}.markdown-content ol ol ol{list-style-type:lower-roman}.markdown-content li::marker{color:var(--app-secondary-foreground)}.markdown-content li{margin-bottom:.25em}.markdown-content li>p{margin-top:.5em;margin-bottom:.5em}.markdown-content blockquote{margin:0 0 1em;padding:0 1em;border-left:.25em solid var(--app-primary-border-color);color:var(--app-secondary-foreground)}.markdown-content a{color:var(--app-link-foreground, #007acc);text-decoration:none}.markdown-content a:hover{color:var(--app-link-active-foreground, #005a9e);text-decoration:underline}.markdown-content code{font-family:var( --app-monospace-font-family, "SF Mono", Monaco, "Cascadia Code", "Roboto Mono", Consolas, "Courier New", monospace );font-size:.9em;background-color:var(--app-code-background, rgba(0, 0, 0, .05));border:1px solid var(--app-primary-border-color);border-radius:var(--corner-radius-small, 4px);padding:.2em .4em;white-space:pre-wrap;word-break:break-word}.markdown-content pre{margin:1em 0;padding:1em;overflow-x:auto;background-color:var(--app-code-background, rgba(0, 0, 0, .05));border:1px solid var(--app-primary-border-color);border-radius:var(--corner-radius-small, 4px);font-family:var( --app-monospace-font-family, "SF Mono", Monaco, "Cascadia Code", "Roboto Mono", Consolas, "Courier New", monospace );font-size:.9em;line-height:1.5}.markdown-content pre code{background:none;border:none;padding:0;white-space:pre-wrap;word-break:break-word}.markdown-content .file-path-link{background:transparent;border:none;padding:0;font-family:var( --app-monospace-font-family, "SF Mono", Monaco, "Cascadia Code", "Roboto Mono", Consolas, "Courier New", monospace );font-size:.95em;color:inherit;text-decoration:none;cursor:pointer}.markdown-content hr{border:none;border-top:1px solid var(--app-primary-border-color);margin:1.5em 0}.markdown-content img{max-width:100%;height:auto}.markdown-content table{width:100%;border-collapse:collapse;margin:1em 0}.markdown-content th,.markdown-content td{padding:.5em 1em;border:1px solid var(--app-primary-border-color);text-align:left}.markdown-content th{background-color:var(--app-secondary-background);font-weight:600}/**\n * @license\n * Copyright 2025 Qwen Team\n * SPDX-License-Identifier: Apache-2.0\n *\n * ThinkingMessage.css - Thinking message styles with timeline support\n */.thinking-message{position:relative;--timeline-center-offset: 15px;padding-left:30px;padding-top:8px;padding-bottom:8px;-webkit-user-select:text;-moz-user-select:text;user-select:text;align-items:flex-start;border-radius:6px;animation:fadeIn .2s ease-in}.thinking-message:after{content:"";position:absolute;left:12px;top:0;bottom:0;width:1px;background-color:var(--app-primary-border-color, rgba(255, 255, 255, .15))}.thinking-message:first-child:after{top:var(--timeline-center-offset, 15px)}.thinking-message:last-child:after{bottom:calc(100% - var(--timeline-center-offset, 15px))}.thinking-message:first-child:last-child:after{display:none}.thinking-message.thinking-status-default:before,.thinking-message.thinking-status-loading:before{content:"\u25CF";position:absolute;left:8px;top:8px;font-size:10px;line-height:1.5;z-index:1}.thinking-message.thinking-status-default:before{color:var(--app-secondary-foreground);opacity:.6}.thinking-message.thinking-status-loading:before{color:var(--app-secondary-foreground);animation:thinkingPulse 1s linear infinite}@keyframes thinkingPulse{0%,to{opacity:1}50%{opacity:.4}}.thinking-content-wrapper{flex:1;display:flex;flex-direction:column;gap:8px;min-width:0;max-width:100%}.thinking-toggle-btn{display:inline-flex;align-items:center;gap:4px;background:transparent;border:none;cursor:pointer;padding:0;text-align:left;color:var(--app-secondary-foreground);line-height:1;height:15px}.thinking-toggle-btn:hover{opacity:.8}.thinking-label{font-size:14px;font-style:italic;color:var(--app-secondary-foreground);opacity:.8;line-height:1}.thinking-chevron{color:var(--app-tertiary-foreground, #666);opacity:.7}.thinking-content{font-size:13px;line-height:1.5;color:var(--app-secondary-foreground);opacity:.8;white-space:pre-wrap;word-break:break-word;padding-left:8px;margin-top:4px}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}/**\n * @license\n * Copyright 2025 Qwen Team\n * SPDX-License-Identifier: Apache-2.0\n *\n * AssistantMessage Component Styles\n * Pseudo-elements (::before) for bullet points and (::after) for timeline connectors\n */.assistant-message-container{position:relative;--timeline-center-offset: 13px;padding-left:30px;padding-top:8px;padding-bottom:8px;border-radius:6px}.assistant-message-container.assistant-message-default:before,.assistant-message-container.assistant-message-success:before,.assistant-message-container.assistant-message-error:before,.assistant-message-container.assistant-message-warning:before,.assistant-message-container.assistant-message-loading:before{content:"\u25CF";position:absolute;left:8px;top:8px;font-size:10px;line-height:20px;z-index:1}.assistant-message-container.assistant-message-default:before{color:var(--app-secondary-foreground)}.assistant-message-container.assistant-message-success:before{color:#74c991}.assistant-message-container.assistant-message-error:before{color:#c74e39}.assistant-message-container.assistant-message-warning:before{color:#e1c08d}.assistant-message-container.assistant-message-loading:before{color:var(--app-secondary-foreground);animation:assistantPulse 1s linear infinite}@keyframes assistantPulse{0%,to{opacity:1}50%{opacity:.5}}.assistant-message-container:after{content:"";position:absolute;left:12px;top:0;bottom:0;width:1px;background-color:var(--app-primary-border-color, rgba(255, 255, 255, .15))}.assistant-message-container:first-child:after{top:var(--timeline-center-offset, 13px)}.assistant-message-container:last-child:after{bottom:calc(100% - var(--timeline-center-offset, 13px))}.assistant-message-container:first-child:last-child:after{display:none}.assistant-message-container.assistant-message-loading:after{display:none}/**\n * @license\n * Copyright 2025 Qwen Team\n * SPDX-License-Identifier: Apache-2.0\n *\n * LayoutComponents.css - Tool call layout styles with timeline support\n */.toolcall-container{position:relative;--timeline-center-offset: 15px;padding-left:30px;padding-top:8px;padding-bottom:8px;-webkit-user-select:text;-moz-user-select:text;user-select:text;align-items:flex-start;border-radius:6px}.toolcall-container:after{content:"";position:absolute;left:12px;top:0;bottom:0;width:1px;background-color:var(--app-primary-border-color, rgba(255, 255, 255, .15))}.toolcall-container:first-child:after{top:var(--timeline-center-offset, 15px)}.toolcall-container:last-child:after{bottom:calc(100% - var(--timeline-center-offset, 15px))}.toolcall-container:first-child:last-child:after{display:none}.toolcall-container.toolcall-status-default:before,.toolcall-container.toolcall-status-success:before,.toolcall-container.toolcall-status-error:before,.toolcall-container.toolcall-status-warning:before,.toolcall-container.toolcall-status-loading:before{content:"\u25CF";position:absolute;left:8px;top:8px;font-size:10px;line-height:1.5;z-index:1}.toolcall-container.toolcall-status-default:before{color:var(--app-secondary-foreground)}.toolcall-container.toolcall-status-success:before{color:#74c991}.toolcall-container.toolcall-status-error:before{color:#c74e39}.toolcall-container.toolcall-status-warning:before{color:#e1c08d}.toolcall-container.toolcall-status-loading:before{color:var(--app-secondary-foreground);animation:toolcallPulse 1s linear infinite}@keyframes toolcallPulse{0%,to{opacity:1}50%{opacity:.5}}.toolcall-content-wrapper{flex:1;display:flex;flex-direction:column;gap:6px;min-width:0;max-width:100%}.toolcall-card{grid-template-columns:auto 1fr;gap:var(--spacing-medium);background:var(--app-input-background);border:1px solid var(--app-input-border);border-radius:var(--border-radius-medium);padding:var(--spacing-large);margin:var(--spacing-medium) 0;align-items:start;animation:fadeIn .2s ease-in}.toolcall-row{grid-template-columns:80px 1fr;gap:var(--spacing-medium);min-width:0}.toolcall-row-label{font-size:var(--font-size-xs);color:var(--app-secondary-foreground);font-weight:500;padding-top:2px}.toolcall-row-content{color:var(--app-primary-foreground);min-width:0;word-break:break-word}.toolcall-locations-list{display:flex;flex-direction:column;gap:4px;max-width:100%}.toolcall-header{position:relative}.toolcall-header:before{content:"\u25CF";position:absolute;left:-22px;top:50%;transform:translateY(-50%);font-size:10px;line-height:1;z-index:1;color:#e1c08d;animation:toolcallHeaderPulse 1.5s ease-in-out infinite}@keyframes toolcallHeaderPulse{0%,to{opacity:1}50%{opacity:.5}}.in-progress-toolcall .toolcall-content-wrapper{display:flex;flex-direction:column;gap:1;min-width:0;max-width:100%}.in-progress-toolcall .toolcall-header{display:flex;align-items:center;gap:2;position:relative;min-width:0}.in-progress-toolcall .toolcall-content-text{word-break:break-word;white-space:pre-wrap;width:100%}/**\n * @license\n * Copyright 2025 Qwen Team\n * SPDX-License-Identifier: Apache-2.0\n *\n * Shell tool call styles - shared styles for bash/execute variants\n */.bash-toolcall-card{border:.5px solid var(--app-input-border);border-radius:5px;background:var(--app-tool-background);margin:8px 0;max-width:100%;font-size:1em;align-items:start}.bash-toolcall-content{display:flex;flex-direction:column;gap:3px;padding:4px}.bash-toolcall-row{display:grid;grid-template-columns:max-content 1fr;border-top:.5px solid var(--app-input-border);padding:4px}.bash-toolcall-row:first-child{border-top:none}.bash-toolcall-label{grid-column:1;color:var(--app-secondary-foreground);text-align:left;opacity:50%;padding:4px 8px 4px 4px;font-family:var(--app-font-mono);font-size:.85em}.bash-toolcall-row-content{grid-column:2;white-space:pre-wrap;word-break:break-word;margin:0;padding:4px}.bash-toolcall-row-content:not(.bash-toolcall-full){max-height:60px;-webkit-mask-image:linear-gradient(to bottom,var(--app-primary-background) 40px,transparent 60px);mask-image:linear-gradient(to bottom,var(--app-primary-background) 40px,transparent 60px);overflow:hidden}.bash-toolcall-row-content.bash-toolcall-full{min-width:0}.bash-toolcall-pre{margin-block:0;overflow:hidden;font-family:var(--app-font-mono);font-size:.85em}.bash-toolcall-code{margin:0;padding:0;font-family:var(--app-font-mono);font-size:.85em}.bash-toolcall-output-subtle{background-color:var(--app-code-background);white-space:pre;overflow-x:auto;max-width:100%;min-width:0;width:100%;box-sizing:border-box}.bash-toolcall-output-subtle .bash-toolcall-pre{overflow:visible}.bash-toolcall-error-content{color:#c74e39}.bash-toolcall-row-with-copy{position:relative;grid-template-columns:max-content 1fr max-content}.execute-toolcall-card{border:.5px solid var(--app-input-border);border-radius:5px;background:var(--app-tool-background);margin:8px 0;max-width:100%;font-size:1em;align-items:start}.execute-toolcall-content{display:flex;flex-direction:column;gap:3px;padding:4px}.execute-toolcall-row{display:grid;grid-template-columns:max-content 1fr;border-top:.5px solid var(--app-input-border);padding:4px}.execute-toolcall-row:first-child{border-top:none}.execute-toolcall-label{grid-column:1;color:var(--app-secondary-foreground);text-align:left;opacity:50%;padding:4px 8px 4px 4px;font-family:var(--app-font-mono);font-size:.85em}.execute-toolcall-row-content{grid-column:2;white-space:pre-wrap;word-break:break-word;margin:0;padding:4px}.execute-toolcall-row-content:not(.execute-toolcall-full){max-height:60px;-webkit-mask-image:linear-gradient(to bottom,var(--app-primary-background) 40px,transparent 60px);mask-image:linear-gradient(to bottom,var(--app-primary-background) 40px,transparent 60px);overflow:hidden}.execute-toolcall-row-content.execute-toolcall-full{min-width:0}.execute-toolcall-pre{margin-block:0;overflow:hidden;font-family:var(--app-font-mono);font-size:.85em}.execute-toolcall-code{margin:0;padding:0;font-family:var(--app-font-mono);font-size:.85em}.execute-toolcall-output-subtle{white-space:pre;overflow-x:auto;max-width:100%;min-width:0;width:100%;box-sizing:border-box}.execute-toolcall-output-subtle .execute-toolcall-pre{overflow:visible}.execute-toolcall-error-content{color:#c74e39}.execute-toolcall-row-with-copy{position:relative;grid-template-columns:max-content 1fr max-content}/**\n * @license\n * Copyright 2025 Qwen Team\n * SPDX-License-Identifier: Apache-2.0\n *\n * ChatViewer component styles - matching vscode-ide-companion visual appearance\n * Note: Timeline styles are inherited from shared styles/timeline.css\n */.chat-viewer-container{display:flex;flex-direction:column;width:100%;height:100%;background-color:var( --app-background, var(--app-primary-background, #1e1e1e) );color:var(--app-primary-foreground, #cccccc);font-family:var( --vscode-chat-font-family, var( --vscode-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif ) );font-size:var(--vscode-chat-font-size, 13px);overflow:hidden}.chat-viewer-messages{flex:1;overflow-y:auto;overflow-x:hidden;padding:20px;display:flex;flex-direction:column;position:relative;min-width:0;scroll-behavior:smooth}.chat-viewer-expand-control{display:flex;justify-content:flex-end;gap:8px;padding:10px 20px 0;flex-shrink:0}.chat-viewer-expand-control-button{background:transparent;border:1px solid var(--app-input-border, rgba(255, 255, 255, .2));border-radius:4px;color:var(--app-secondary-foreground, rgba(255, 255, 255, .6));cursor:pointer;font-size:11px;line-height:1.4;padding:3px 10px;transition:color .15s ease,border-color .15s ease,background-color .15s ease}.chat-viewer-expand-control-button:hover{color:var(--app-primary-foreground, #cccccc);border-color:var(--app-primary-foreground, #cccccc);background-color:var(--app-input-background, rgba(255, 255, 255, .06))}@media (max-width: 600px){.chat-viewer-expand-control{padding:8px 12px 0}}.chat-viewer-messages::-webkit-scrollbar{width:8px}.chat-viewer-messages::-webkit-scrollbar-track{background:transparent}.chat-viewer-messages::-webkit-scrollbar-thumb{background:#fff3;border-radius:4px}.chat-viewer-messages::-webkit-scrollbar-thumb:hover{background:#ffffff4d}@media (prefers-color-scheme: light){.chat-viewer-container.auto-theme .chat-viewer-messages::-webkit-scrollbar-thumb{background:#0003}.chat-viewer-container.auto-theme .chat-viewer-messages::-webkit-scrollbar-thumb:hover{background:#0000004d}}.chat-viewer-container.light-theme .chat-viewer-messages::-webkit-scrollbar-thumb{background:#0003}.chat-viewer-container.light-theme .chat-viewer-messages::-webkit-scrollbar-thumb:hover{background:#0000004d}.chat-viewer-messages>*{display:flex;gap:0;align-items:flex-start;text-align:left;padding-top:8px;padding-bottom:8px;flex-direction:column;position:relative;animation:chatViewerFadeIn .2s ease-in}.chat-viewer-messages>.chat-viewer-scroll-anchor{padding:0;display:block}.chat-viewer-messages>*{overflow-anchor:none}.chat-viewer-messages .user-message-container:first-child{margin-top:0}@keyframes chatViewerFadeIn{0%{opacity:0;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}.chat-viewer-empty{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;min-height:200px;color:var(--app-secondary-foreground, rgba(255, 255, 255, .6));font-size:14px;text-align:center;padding:20px}.chat-viewer-empty-icon{font-size:48px;margin-bottom:16px;opacity:.5}.chat-viewer-empty-text{max-width:300px;line-height:1.5}.chat-viewer-scroll-anchor{height:1px;overflow-anchor:auto}.chat-viewer-messages .user-message-container{margin-top:16px}.chat-viewer-messages>*{isolation:isolate}@media (max-width: 600px){.chat-viewer-messages{padding:12px}}\n </style>\n <title>Qwen Code Chat Export</title>\n <script>\n // Pre-hydrate FOUC guard: must run before <style> below applies layout.\n // The storage key \'qwen-export-theme\' is duplicated here verbatim and\n // MUST stay in sync with EXPORT_THEME_STORAGE_KEY in\n // src/components/useExportTheme.ts.\n (function () {\n try {\n var stored = window.localStorage.getItem(\'qwen-export-theme\');\n var theme = stored === \'light\' || stored === \'dark\' ? stored : \'dark\';\n var root = document.documentElement;\n // Toggle-style writes mirror the React hook\'s effect, so the two\n // code paths converge on identical class state.\n root.classList.toggle(\'light\', theme === \'light\');\n root.classList.toggle(\'dark\', theme === \'dark\');\n } catch (e) {\n // localStorage may be unavailable (private mode, file:// sandbox);\n // the static class="dark" attribute on <html> remains the default.\n }\n })();\n </script>\n <style>\n @font-face {\n font-family: "Press Start 2P";\n font-style: normal;\n font-weight: 400;\n font-display: swap;\n src: url("data:font/woff2;base64,d09GMgABAAAAAALQAAwAAAAABfwAAAKBAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHCgGYABUEQgKgkSCDAsOAAE2AiQDDgQgBYRKByAb4QTIBB76Oev9JKW02x5ClpELSxHm1M0JQ+OBJAtDpAAVUQ7i///V+A/YgLVswlGo/7a+lmW3sfnUvoBFcUKzUFEnKo08S0F2T8TiAAJQieDvSGUVdW3smBv2LuCGjSpG3jQTD/m9OI5lTDomdQG1hkoMkCJu1ZYsmL42dEu7W8q5gUan/J6yyO+FX5NO5qQPxaqGnEINZ2q7kDf0+i4UigAXdiQUNMppoJnOzcxnDMwX5lXzinnJPDtkzhQFwjTx0DGrx1zkoNhIYr5LTKHjclcs+z3Frrh2ue3Kvk6bxzoRJLsIQpWcQhW27bgJwoUHYXNi2WWnVRUWaVNS0XMJ1eIUHlSX0l3l7BZOOos1ySk7NUWl6+eobG3Nfpj96g8EvukB3Qjouo4+O6svG9/0b8ZyKmfoZj9gzBqq8I2MS7Pf2JquL9vZwHJ51djyD01vbVHRDxSslvFBZwMHjQvexMxIvz3oyftul2+k9yBS+xGM+l+d+Pvo/zH5fVXMRvsHhG4u9/dRsgQyF67l9+jYgZuy+Ath2O6EUzU7E6BxF41nQk2cgkN8IIlOPKecMgWccSrE4XdaOECf00oUaeTm34EpvHhZIodEEllllBWmWcJLyQmsPjNHAousMEkijVRQR5OgNc4qq7TiZZg89pJCE/G0MM4kPuYqqIOKrQw3WmQBjVQSSLLm1H1NiGmCN21uwK/JpZRuWignd/klmbWXFEtZZIn1o8cmkaDqX5JIJgWNNqYYR9s0GsRFZhhntKJSjI+KTaFDZ+MoRllkjHWK2ADCxilLQGTkJZo4NAJMDwhAiK0CJD+jjKFRwWBapYFh5rdzfogQC/m1XLplXiEFEwAA") format("woff2");\n }\n :root{--bg-primary: #18181b;--bg-secondary: #27272a;--text-primary: #f4f4f5;--text-secondary: #a1a1aa;--border-color: #3f3f46;--accent-color: #3b82f6;--header-bg: rgba(24, 24, 27, .95);--scrollbar-thumb-hover: #52525b}:root.light{--bg-primary: #ffffff;--bg-secondary: #f3f4f6;--text-primary: #1f2937;--text-secondary: #6b7280;--border-color: #e5e7eb;--accent-color: #2563eb;--header-bg: rgba(249, 250, 251, .95);--scrollbar-thumb-hover: #d1d5db;--app-primary-foreground: #1f2937;--app-secondary-foreground: #6b7280;--app-background: #ffffff;--app-primary-background: #ffffff;--app-background-secondary: #f3f4f6;--app-background-tertiary: #e5e7eb;--app-foreground: #1f2937;--app-foreground-secondary: #6b7280;--app-foreground-muted: #9ca3af;--app-border: #e5e7eb;--app-primary-border-color: #e5e7eb;--app-input-background: #ffffff;--app-input-border: #d1d5db;--app-input-placeholder-foreground: #9ca3af;--app-ghost-button-hover-background: rgba(0, 0, 0, .05);--app-header-background: #f9fafb;--app-list-hover-background: rgba(0, 0, 0, .05);--app-list-active-background: #3b82f6;--app-menu-background: #ffffff;--app-menu-border: #e5e7eb;--app-menu-foreground: #1f2937;--app-tool-background: #ffffff;--app-code-background: #f3f4f6;--app-secondary-background: #f3f4f6;--app-input-secondary-background: #f3f4f6;--app-input-foreground: #1f2937;--app-button-background: #e5e7eb;--app-button-secondary-background: #f3f4f6;--app-button-foreground: #1f2937;--app-transparent-inner-border: rgba(0, 0, 0, .1);--app-warning-foreground: #b45309}body{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;margin:0;padding:0;background-color:var(--bg-primary);color:var(--text-primary);line-height:1.6;-webkit-font-smoothing:antialiased}.page-wrapper{min-height:100vh;display:flex;flex-direction:column;align-items:center}.header{width:100%;padding:16px 24px;border-bottom:1px solid var(--border-color);background-color:var(--header-bg);backdrop-filter:blur(8px);position:sticky;top:0;z-index:100;display:flex;justify-content:space-between;align-items:center;box-sizing:border-box}.header-left{display:flex;align-items:center;gap:12px}.header-right{display:flex;align-items:center;gap:8px}.theme-toggle{display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;padding:0;background:transparent;border:1px solid var(--border-color);border-radius:999px;color:var(--text-secondary);cursor:pointer;transition:background-color .15s ease,color .15s ease,border-color .15s ease}.theme-toggle:hover{background-color:var(--bg-secondary);color:var(--text-primary)}.theme-toggle:focus-visible{outline:2px solid var(--accent-color);outline-offset:2px}.theme-toggle:active{transform:scale(.95)}.logo-icon{width:24px;height:24px;flex-shrink:0;display:flex;align-items:center;justify-content:center}.logo-icon svg{width:100%;height:100%}.logo{display:flex;flex-direction:column;line-height:1}.logo-text{font-family:"Press Start 2P",cursive;font-weight:400;font-size:24px;letter-spacing:-.05em;position:relative;color:#fff}.logo-text-inner{background:linear-gradient(to right,#60a5fa,#a855f7);-webkit-background-clip:text;-webkit-text-fill-color:transparent;position:relative;z-index:2}.logo-text:before,.logo-text:after{content:attr(data-text);position:absolute;top:0;left:0;width:100%;height:100%;z-index:1;background:none;-webkit-text-fill-color:transparent;-webkit-text-stroke:1px rgba(96,165,250,.3)}.logo-text:before{transform:translate(2px,2px);-webkit-text-stroke:1px rgba(168,85,247,.3)}.logo-text:after{transform:translate(4px,4px);opacity:.4}.logo-sub{font-size:11px;font-weight:600;color:var(--text-secondary);letter-spacing:.05em;text-transform:uppercase;margin-top:4px}.badge{font-size:11px;padding:2px 8px;border-radius:999px;background-color:var(--bg-secondary);color:var(--text-secondary);border:1px solid var(--border-color);font-weight:500}.meta{display:flex;gap:24px;font-size:13px;color:var(--text-secondary)}.meta-item{display:flex;align-items:center;gap:8px}.meta-label{color:var(--text-secondary)}::-webkit-scrollbar{width:10px;height:10px}::-webkit-scrollbar-track{background:var(--bg-primary)}::-webkit-scrollbar-thumb{background:var(--bg-secondary);border-radius:5px;border:2px solid var(--bg-primary)}::-webkit-scrollbar-thumb:hover{background:var(--scrollbar-thumb-hover)}@media (max-width: 768px){.chat-container{max-width:100%;padding:20px 16px}.header{padding:12px 16px}.meta{width:100%;flex-direction:column;gap:6px}}@media (max-width: 480px){.chat-container{padding:16px 12px}}.content-wrapper{display:flex;width:100%;max-width:1600px;height:calc(100vh - 73px)}.chat-container{flex:1;min-width:0;overflow-y:auto;padding:24px;box-sizing:border-box}.metadata-sidebar{width:320px;min-width:320px;padding:12px;border-right:1px solid var(--border-color);background-color:var(--bg-secondary);display:flex;flex-direction:column;gap:12px;overflow-y:auto;height:100%;box-sizing:border-box}.metadata-section{display:flex;flex-direction:column;gap:8px}.metadata-section-title{font-size:10px;font-weight:600;color:var(--text-secondary);text-transform:uppercase;letter-spacing:.05em;margin:0;padding-bottom:4px;border-bottom:1px solid var(--border-color)}.metadata-section-small{margin-top:auto;padding-top:12px;border-top:1px solid var(--border-color)}.metadata-item{display:flex;flex-direction:column;gap:2px}.metadata-item-empty{font-size:12px;color:var(--text-secondary);margin:0;padding:4px 0}.metadata-content{display:flex;flex-direction:column;gap:2px;min-width:0}.metadata-content .metadata-label{font-size:10px;color:var(--text-secondary)}.metadata-content .metadata-value{font-size:12px;color:var(--text-primary);word-break:break-all;line-height:1.3;cursor:pointer}.metadata-content .metadata-value.multiline{white-space:pre-wrap}.metadata-content .metadata-value.text-green{color:#22c55e}.metadata-content .metadata-value.text-red{color:#ef4444}.metadata-value-with-copy{display:flex;align-items:center;gap:8px}.metadata-value-with-copy .metadata-value{flex:1;min-width:0}.copy-button{display:inline-flex;align-items:center;justify-content:center;padding:4px;background:transparent;border:1px solid var(--border-color, #3f3f46);border-radius:4px;color:var(--text-secondary, #a1a1aa);cursor:pointer;transition:all .15s ease;flex-shrink:0}.copy-button:hover{background:var(--bg-hover, #27272a);color:var(--text-primary, #f4f4f5);border-color:var(--border-hover, #52525b)}.copy-button:active{transform:scale(.95)}@media (max-width: 1024px){.metadata-sidebar{width:320px;min-width:320px;padding:10px}}@media (max-width: 768px){.content-wrapper{flex-direction:column;height:auto}.chat-container{height:auto;min-height:50vh}.metadata-sidebar{width:100%;min-width:100%;height:auto;max-height:none;border-right:none;border-top:1px solid var(--border-color);padding:12px;gap:12px}.metadata-section{flex-direction:row;flex-wrap:wrap;gap:12px}.metadata-section-title{width:100%;border-bottom:none;padding-bottom:0}.metadata-item{flex:1;min-width:140px}.metadata-section-small{margin-top:0;padding-top:0;border-top:none}}.modal-overlay{position:fixed;inset:0;z-index:1000;background-color:#0009;display:flex;align-items:center;justify-content:center;padding:24px}.modal-container{background-color:var(--bg-secondary);border:1px solid var(--border-color);border-radius:12px;width:100%;max-width:800px;max-height:80vh;display:flex;flex-direction:column;box-shadow:0 25px 50px -12px #00000080}.modal-header{display:flex;align-items:center;justify-content:space-between;padding:12px 16px;border-bottom:1px solid var(--border-color);flex-shrink:0}.modal-title{font-size:13px;color:var(--text-secondary);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.modal-close{background:none;border:none;color:var(--text-secondary);cursor:pointer;font-size:16px;padding:4px 8px;border-radius:6px;line-height:1;transition:background-color .15s,color .15s}.modal-close:hover{background-color:var(--border-color);color:var(--text-primary)}.modal-content{margin:0;padding:16px;overflow:auto;font-size:13px;line-height:1.6;color:var(--text-primary);white-space:pre-wrap;word-break:break-word}\n </style>\n </head>\n <body>\n <div id="app"></div>\n\n <script id="chat-data" type="application/json"></script>\n <script>\n (()=>{var f=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 141.38 140">\n <path\n fill="#000000"\n d="m140.93 85-16.35-28.33-1.93-3.34 8.66-15a3.323 3.323 0 0 0 0-3.34l-9.62-16.67c-.3-.51-.72-.93-1.22-1.22s-1.07-.45-1.67-.45H82.23l-8.66-15a3.33 3.33 0 0 0-2.89-1.67H51.43c-.59 0-1.17.16-1.66.45-.5.29-.92.71-1.22 1.22L32.19 29.98l-1.92 3.33H12.96c-.59 0-1.17.16-1.66.45-.5.29-.93.71-1.22 1.22L.45 51.66a3.323 3.323 0 0 0 0 3.34l18.28 31.67-8.66 15a3.32 3.32 0 0 0 0 3.34l9.62 16.67c.3.51.72.93 1.22 1.22s1.07.45 1.67.45h36.56l8.66 15a3.35 3.35 0 0 0 2.89 1.67h19.25a3.34 3.34 0 0 0 2.89-1.67l18.28-31.67h17.32c.6 0 1.17-.16 1.67-.45s.92-.71 1.22-1.22l9.62-16.67a3.323 3.323 0 0 0 0-3.34ZM51.44 3.33 61.07 20l-9.63 16.66h76.98l-9.62 16.66H45.67l-11.54-20zM57.21 120H22.58l9.63-16.67h19.25l-38.5-66.67h19.25l9.62 16.67L68.78 100l-11.55 20Zm61.59-33.34-9.62-16.67-38.49 66.67-9.63-16.67 9.63-16.66 26.94-46.67h23.1l17.32 30z"\n />\n</svg>\n`;var l=window.React,h=({state:e,onClose:t})=>(l.useEffect(()=>{if(e.visible){let o=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=o}}},[e.visible]),e.visible?l.createElement("div",{className:"modal-overlay",onClick:t},l.createElement("div",{className:"modal-container",onClick:o=>o.stopPropagation()},l.createElement("div",{className:"modal-header"},l.createElement("span",{className:"modal-title font-mono"},e.fileName),l.createElement("button",{className:"modal-close",onClick:t,"aria-label":"Close"},"\\u2715")),l.createElement("pre",{className:"modal-content"},e.content))):null),x=()=>{let[e,t]=l.useState({visible:!1,content:"",fileName:""}),o=l.useCallback((n,p="temp")=>{t({visible:!0,content:n,fileName:p})},[]),i=l.useCallback(()=>{t(n=>({...n,visible:!1}))},[]);return{modalState:e,openModal:o,closeModal:i}};var z=window.React,b=()=>{let{modalState:e,openModal:t,closeModal:o}=x();return{platformContext:z.useMemo(()=>({platform:"web",postMessage:n=>{console.log("Posted message:",n)},onMessage:n=>(window.addEventListener("message",n),()=>window.removeEventListener("message",n)),openFile:n=>{console.log("Opening file:",n)},openTempFile:t,getResourceUrl:()=>{},features:{canOpenFile:!1,canOpenTempFile:!0,canCopy:!0}}),[t]),modalState:e,closeModal:o}};var a=({label:e,value:t,valueClass:o})=>t==null||t===""?null:React.createElement("div",{className:"metadata-item"},React.createElement("div",{className:"metadata-content"},React.createElement("span",{className:"metadata-label"},e),React.createElement("span",{className:`metadata-value ${o||""}`,title:typeof t=="string"?t:void 0},t)));var v=e=>!!e&&typeof e=="object",w=()=>{let e=document.getElementById("chat-data");if(!(e!=null&&e.textContent))return{};try{let t=JSON.parse(e.textContent);return t&&typeof t=="object"?t:{}}catch(t){return console.error("Failed to parse chat data.",t),{}}};var y=e=>{if(!e)return"-";try{return new Date(e).toLocaleString("en-US",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}catch(t){return e}},k=e=>{if(!e)return"-";try{let o=new Date(e).getTime();if(Number.isNaN(o))return"-";let n=Math.max(0,new Date().getTime()-o),p=Math.floor(n/1e3),c=Math.floor(p/60),d=Math.floor(c/60),s=Math.floor(d/24),m=Math.floor(s/7),g=Math.floor(s/30),u=Math.floor(s/365);return p<60?"just now":c<60?`${c} minute${c===1?"":"s"} ago`:d<24?`${d} hour${d===1?"":"s"} ago`:s<7?`${s} day${s===1?"":"s"} ago`:m<4?`${m} week${m===1?"":"s"} ago`:g<12?`${g} month${g===1?"":"s"} ago`:`${u} year${u===1?"":"s"} ago`}catch(t){return"-"}};var M=e=>{if(e!=null)return e>=1e6?`${(e/1e6).toFixed(e%1e6===0?0:1)}m`:e>=1e3?`${(e/1e3).toFixed(e%1e3===0?0:1)}k`:e.toString()};var T=({metadata:e})=>React.createElement("aside",{className:"metadata-sidebar"},React.createElement("div",{className:"metadata-section"},React.createElement("h3",{className:"metadata-section-title"},"Session Info"),React.createElement(a,{label:"Session created",value:k(e.startTime)}),React.createElement(a,{label:"Project",value:e.cwd,valueClass:"multiline"}),e.gitRepo&&React.createElement(a,{label:"Repository",value:e.gitRepo}),e.gitBranch&&React.createElement(a,{label:"Branch",value:e.gitBranch}),e.model&&React.createElement(a,{label:"Model",value:e.model}),e.channel&&React.createElement(a,{label:"Channel",value:e.channel})),React.createElement("div",{className:"metadata-section"},React.createElement("h3",{className:"metadata-section-title"},"Statistics"),React.createElement(a,{label:"Prompts",value:e.promptCount}),e.contextUsagePercent!==void 0&&e.contextWindowSize!==void 0&&React.createElement(a,{label:"Context",value:`${e.contextUsagePercent>100?">100":e.contextUsagePercent}% of ${M(e.contextWindowSize)}`,valueClass:e.contextUsagePercent>100?"text-red":void 0}),e.totalTokens!==void 0&&React.createElement(a,{label:"Tokens",value:e.totalTokens.toLocaleString()})),React.createElement("div",{className:"metadata-section"},React.createElement("h3",{className:"metadata-section-title"},"File Operations"),e.filesWritten!==void 0&&e.filesWritten>0&&React.createElement(a,{label:"Files modified",value:e.filesWritten}),e.linesAdded!==void 0&&e.linesAdded>0&&React.createElement(a,{label:"Added",value:`+${e.linesAdded}`,valueClass:"text-green"}),e.linesRemoved!==void 0&&e.linesRemoved>0&&React.createElement(a,{label:"Removed",value:`-${e.linesRemoved}`,valueClass:"text-red"}),(e.filesWritten===void 0||e.filesWritten===0)&&(e.linesAdded===void 0||e.linesAdded===0)&&(e.linesRemoved===void 0||e.linesRemoved===0)&&React.createElement("p",{className:"metadata-item metadata-item-empty"},"No file changes")),React.createElement("div",{className:"metadata-section metadata-section-small"},React.createElement(a,{label:"Session ID",value:e.sessionId,valueClass:"font-mono"}),React.createElement(a,{label:"Export Time",value:y(e.exportTime)})));var $=()=>React.createElement("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true"},React.createElement("circle",{cx:"12",cy:"12",r:"4"}),React.createElement("path",{d:"M12 2v2"}),React.createElement("path",{d:"M12 20v2"}),React.createElement("path",{d:"m4.93 4.93 1.41 1.41"}),React.createElement("path",{d:"m17.66 17.66 1.41 1.41"}),React.createElement("path",{d:"M2 12h2"}),React.createElement("path",{d:"M20 12h2"}),React.createElement("path",{d:"m6.34 17.66-1.41 1.41"}),React.createElement("path",{d:"m19.07 4.93-1.41 1.41"})),D=()=>React.createElement("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true"},React.createElement("path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z"})),C=({theme:e,onToggle:t})=>{let o=e==="light",i=o?"Switch to dark theme":"Switch to light theme";return React.createElement("button",{type:"button",className:"theme-toggle","aria-label":i,"aria-pressed":o,title:i,onClick:t},React.createElement(o?D:$,null))};var L=window.React,{useCallback:j,useEffect:I,useState:W}=L,N="qwen-export-theme",R=e=>e==="light"||e==="dark",F=()=>{try{let e=window.localStorage.getItem(N);if(R(e))return e}catch(e){}return"dark"},O=e=>{let t=document.documentElement;t.classList.toggle("light",e==="light"),t.classList.toggle("dark",e==="dark")},S=()=>{let[e,t]=W(F);I(()=>{O(e);try{window.localStorage.setItem(N,e)}catch(i){}},[e]);let o=j(()=>{t(i=>i==="light"?"dark":"light")},[]);return{theme:e,toggleTheme:o}};var A=window.ReactDOM,r=window.React,{ChatViewer:U,PlatformProvider:V}=QwenCodeWebUI,B=f?f.replace(/<svg([^>]*)>/,\'<svg$1><defs><linearGradient id="qwen-logo-gradient" x1="0%" y1="0%" x2="100%" y2="0%"><stop offset="0%" stop-color="#60a5fa" /><stop offset="100%" stop-color="#a855f7" /></linearGradient></defs>\').replace(/fill="[^"]*"/,\'fill="url(#qwen-logo-gradient)"\'):f,H=()=>{let e=w(),o=(Array.isArray(e.messages)?e.messages:[]).filter(v).filter(m=>m.type!=="system"),i=e.metadata,{platformContext:n,modalState:p,closeModal:c}=b(),{theme:d,toggleTheme:s}=S();return r.createElement("div",{className:"page-wrapper"},r.createElement("header",{className:"header"},r.createElement("div",{className:"header-left"},r.createElement("div",{className:"logo-icon","aria-hidden":"true",dangerouslySetInnerHTML:{__html:B}}),r.createElement("div",{className:"logo"},r.createElement("div",{className:"logo-text","data-text":"QWEN"},r.createElement("span",{className:"logo-text-inner"},"QWEN")))),r.createElement("div",{className:"header-right"},r.createElement(C,{theme:d,onToggle:s}))),r.createElement("div",{className:"content-wrapper"},r.createElement("div",{className:"chat-container"},r.createElement(V,{value:n},r.createElement(U,{messages:o,autoScroll:!1,theme:d,showExpandControl:!0}))),i&&r.createElement(T,{metadata:i})),r.createElement(h,{state:p,onClose:c}))},E=document.getElementById("app");E?A.createRoot(E).render(r.createElement(H,null)):console.error("App container not found.");})();;\n </script>\n </body>\n</html>\n';
|
|
3583
|
+
|
|
3584
|
+
// packages/cli/src/ui/utils/export/formatters/html.ts
|
|
3585
|
+
function escapeJsonForHtml(json) {
|
|
3586
|
+
return json.replace(/<\/script/gi, "<\\/script").replace(/&/g, "\\u0026").replace(/</g, "\\u003c").replace(/>/g, "\\u003e").replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029");
|
|
3587
|
+
}
|
|
3588
|
+
__name(escapeJsonForHtml, "escapeJsonForHtml");
|
|
3589
|
+
function loadHtmlTemplate() {
|
|
3590
|
+
return HTML_TEMPLATE;
|
|
3591
|
+
}
|
|
3592
|
+
__name(loadHtmlTemplate, "loadHtmlTemplate");
|
|
3593
|
+
function injectDataIntoHtmlTemplate(template, data) {
|
|
3594
|
+
const jsonData = JSON.stringify(data, null, 2);
|
|
3595
|
+
const escapedJsonData = escapeJsonForHtml(jsonData);
|
|
3596
|
+
const idAttribute = 'id="chat-data"';
|
|
3597
|
+
const idIndex = template.indexOf(idAttribute);
|
|
3598
|
+
if (idIndex === -1) {
|
|
3599
|
+
return template;
|
|
3600
|
+
}
|
|
3601
|
+
const openTagStart = template.lastIndexOf("<script", idIndex);
|
|
3602
|
+
if (openTagStart === -1) {
|
|
3603
|
+
return template;
|
|
3604
|
+
}
|
|
3605
|
+
const openTagEnd = template.indexOf(">", idIndex);
|
|
3606
|
+
if (openTagEnd === -1) {
|
|
3607
|
+
return template;
|
|
3608
|
+
}
|
|
3609
|
+
const closeTagStart = template.indexOf("</script>", openTagEnd);
|
|
3610
|
+
if (closeTagStart === -1) {
|
|
3611
|
+
return template;
|
|
3612
|
+
}
|
|
3613
|
+
const lineStart = template.lastIndexOf("\n", openTagStart);
|
|
3614
|
+
const lineIndent = lineStart === -1 ? "" : template.slice(lineStart + 1, openTagStart);
|
|
3615
|
+
const indentedJson = escapedJsonData.split("\n").map((line) => `${lineIndent}${line}`).join("\n");
|
|
3616
|
+
const before = template.slice(0, openTagEnd + 1);
|
|
3617
|
+
const after = template.slice(closeTagStart);
|
|
3618
|
+
return `${before}
|
|
3619
|
+
${indentedJson}
|
|
3620
|
+
${after}`;
|
|
3621
|
+
}
|
|
3622
|
+
__name(injectDataIntoHtmlTemplate, "injectDataIntoHtmlTemplate");
|
|
3623
|
+
function toHtml(sessionData) {
|
|
3624
|
+
const template = loadHtmlTemplate();
|
|
3625
|
+
return injectDataIntoHtmlTemplate(template, sessionData);
|
|
3626
|
+
}
|
|
3627
|
+
__name(toHtml, "toHtml");
|
|
3628
|
+
|
|
3629
|
+
// packages/cli/src/ui/utils/export/formatters/json.ts
|
|
3630
|
+
init_esbuild_shims();
|
|
3631
|
+
function toJson(sessionData) {
|
|
3632
|
+
return JSON.stringify(sessionData, null, 2);
|
|
3633
|
+
}
|
|
3634
|
+
__name(toJson, "toJson");
|
|
3635
|
+
|
|
3636
|
+
// packages/cli/src/ui/utils/export/formatters/jsonl.ts
|
|
3637
|
+
init_esbuild_shims();
|
|
3638
|
+
function toJsonl(sessionData) {
|
|
3639
|
+
const lines = [];
|
|
3640
|
+
const sourceMetadata = sessionData.metadata;
|
|
3641
|
+
const metadata = {
|
|
3642
|
+
type: "session_metadata",
|
|
3643
|
+
sessionId: sessionData.sessionId,
|
|
3644
|
+
startTime: sessionData.startTime
|
|
3645
|
+
};
|
|
3646
|
+
if (sourceMetadata?.exportTime) {
|
|
3647
|
+
metadata["exportTime"] = sourceMetadata.exportTime;
|
|
3648
|
+
}
|
|
3649
|
+
if (sourceMetadata?.cwd) {
|
|
3650
|
+
metadata["cwd"] = sourceMetadata.cwd;
|
|
3651
|
+
}
|
|
3652
|
+
if (sourceMetadata?.gitRepo) {
|
|
3653
|
+
metadata["gitRepo"] = sourceMetadata.gitRepo;
|
|
3654
|
+
}
|
|
3655
|
+
if (sourceMetadata?.gitBranch) {
|
|
3656
|
+
metadata["gitBranch"] = sourceMetadata.gitBranch;
|
|
3657
|
+
}
|
|
3658
|
+
if (sourceMetadata?.model) {
|
|
3659
|
+
metadata["model"] = sourceMetadata.model;
|
|
3660
|
+
}
|
|
3661
|
+
if (sourceMetadata?.channel) {
|
|
3662
|
+
metadata["channel"] = sourceMetadata.channel;
|
|
3663
|
+
}
|
|
3664
|
+
if (sourceMetadata?.promptCount !== void 0) {
|
|
3665
|
+
metadata["promptCount"] = sourceMetadata.promptCount;
|
|
3666
|
+
}
|
|
3667
|
+
if (sourceMetadata?.contextUsagePercent !== void 0) {
|
|
3668
|
+
metadata["contextUsagePercent"] = sourceMetadata.contextUsagePercent;
|
|
3669
|
+
}
|
|
3670
|
+
if (sourceMetadata?.contextWindowSize !== void 0) {
|
|
3671
|
+
metadata["contextWindowSize"] = sourceMetadata.contextWindowSize;
|
|
3672
|
+
}
|
|
3673
|
+
if (sourceMetadata?.totalTokens !== void 0) {
|
|
3674
|
+
metadata["totalTokens"] = sourceMetadata.totalTokens;
|
|
3675
|
+
}
|
|
3676
|
+
if (sourceMetadata?.filesWritten !== void 0) {
|
|
3677
|
+
metadata["filesWritten"] = sourceMetadata.filesWritten;
|
|
3678
|
+
}
|
|
3679
|
+
if (sourceMetadata?.linesAdded !== void 0) {
|
|
3680
|
+
metadata["linesAdded"] = sourceMetadata.linesAdded;
|
|
3681
|
+
}
|
|
3682
|
+
if (sourceMetadata?.linesRemoved !== void 0) {
|
|
3683
|
+
metadata["linesRemoved"] = sourceMetadata.linesRemoved;
|
|
3684
|
+
}
|
|
3685
|
+
if (sourceMetadata?.uniqueFiles && sourceMetadata.uniqueFiles.length > 0) {
|
|
3686
|
+
metadata["uniqueFiles"] = sourceMetadata.uniqueFiles;
|
|
3687
|
+
}
|
|
3688
|
+
lines.push(JSON.stringify(metadata));
|
|
3689
|
+
for (const message of sessionData.messages) {
|
|
3690
|
+
lines.push(JSON.stringify(message));
|
|
3691
|
+
}
|
|
3692
|
+
return lines.join("\n");
|
|
3693
|
+
}
|
|
3694
|
+
__name(toJsonl, "toJsonl");
|
|
3695
|
+
|
|
3696
|
+
// packages/cli/src/ui/utils/export/utils.ts
|
|
3697
|
+
init_esbuild_shims();
|
|
3698
|
+
function generateExportFilename(extension) {
|
|
3699
|
+
const timestamp = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-");
|
|
3700
|
+
return `qwen-code-export-${timestamp}.${extension}`;
|
|
3701
|
+
}
|
|
3702
|
+
__name(generateExportFilename, "generateExportFilename");
|
|
3703
|
+
|
|
3704
|
+
// packages/cli/src/ui/utils/export/index.ts
|
|
3705
|
+
init_esbuild_shims();
|
|
3706
|
+
|
|
3707
|
+
// packages/cli/src/utils/json-string-byte-projection.ts
|
|
3708
|
+
init_esbuild_shims();
|
|
3709
|
+
import { Buffer as Buffer2 } from "node:buffer";
|
|
3710
|
+
var JSON_STRING_DELIMITER_BYTES = 2;
|
|
3711
|
+
function jsonPayloadBytesAt(value, index) {
|
|
3712
|
+
const code = value.charCodeAt(index);
|
|
3713
|
+
if (code === 34 || code === 92) return 2;
|
|
3714
|
+
if (code <= 31) {
|
|
3715
|
+
return code === 8 || code === 9 || code === 10 || code === 12 || code === 13 ? 2 : 6;
|
|
3716
|
+
}
|
|
3717
|
+
if (code <= 127) return 1;
|
|
3718
|
+
if (code <= 2047) return 2;
|
|
3719
|
+
if (code >= 55296 && code <= 56319) {
|
|
3720
|
+
const next = value.charCodeAt(index + 1);
|
|
3721
|
+
return next >= 56320 && next <= 57343 ? 4 : 6;
|
|
3722
|
+
}
|
|
3723
|
+
if (code >= 56320 && code <= 57343) return 6;
|
|
3724
|
+
return 3;
|
|
3725
|
+
}
|
|
3726
|
+
__name(jsonPayloadBytesAt, "jsonPayloadBytesAt");
|
|
3727
|
+
function jsonPayloadWidthAt(value, index) {
|
|
3728
|
+
const code = value.charCodeAt(index);
|
|
3729
|
+
if (code < 55296 || code > 56319) return 1;
|
|
3730
|
+
const next = value.charCodeAt(index + 1);
|
|
3731
|
+
return next >= 56320 && next <= 57343 ? 2 : 1;
|
|
3732
|
+
}
|
|
3733
|
+
__name(jsonPayloadWidthAt, "jsonPayloadWidthAt");
|
|
3734
|
+
function jsonStringPayloadByteLength(value, stopAfterBytes = Number.POSITIVE_INFINITY) {
|
|
3735
|
+
let bytes = 0;
|
|
3736
|
+
for (let index = 0; index < value.length; ) {
|
|
3737
|
+
bytes += jsonPayloadBytesAt(value, index);
|
|
3738
|
+
if (bytes > stopAfterBytes) return bytes;
|
|
3739
|
+
index += jsonPayloadWidthAt(value, index);
|
|
3740
|
+
}
|
|
3741
|
+
return bytes;
|
|
3742
|
+
}
|
|
3743
|
+
__name(jsonStringPayloadByteLength, "jsonStringPayloadByteLength");
|
|
3744
|
+
function jsonStringJsonByteLength(value) {
|
|
3745
|
+
return JSON_STRING_DELIMITER_BYTES + jsonStringPayloadByteLength(value);
|
|
3746
|
+
}
|
|
3747
|
+
__name(jsonStringJsonByteLength, "jsonStringJsonByteLength");
|
|
3748
|
+
function jsonPayloadWidthBefore(value, end) {
|
|
3749
|
+
const last = value.charCodeAt(end - 1);
|
|
3750
|
+
if (last >= 56320 && last <= 57343 && end >= 2) {
|
|
3751
|
+
const previous = value.charCodeAt(end - 2);
|
|
3752
|
+
if (previous >= 55296 && previous <= 56319) return 2;
|
|
3753
|
+
}
|
|
3754
|
+
return 1;
|
|
3755
|
+
}
|
|
3756
|
+
__name(jsonPayloadWidthBefore, "jsonPayloadWidthBefore");
|
|
3757
|
+
function selectPrefix(value, budget) {
|
|
3758
|
+
let end = 0;
|
|
3759
|
+
let bytes = 0;
|
|
3760
|
+
while (end < value.length) {
|
|
3761
|
+
const partBytes = jsonPayloadBytesAt(value, end);
|
|
3762
|
+
if (bytes + partBytes > budget) break;
|
|
3763
|
+
bytes += partBytes;
|
|
3764
|
+
end += jsonPayloadWidthAt(value, end);
|
|
3765
|
+
}
|
|
3766
|
+
return end;
|
|
3767
|
+
}
|
|
3768
|
+
__name(selectPrefix, "selectPrefix");
|
|
3769
|
+
function selectSuffix(value, budget) {
|
|
3770
|
+
let start = value.length;
|
|
3771
|
+
let bytes = 0;
|
|
3772
|
+
while (start > 0) {
|
|
3773
|
+
const partWidth = jsonPayloadWidthBefore(value, start);
|
|
3774
|
+
const partBytes = jsonPayloadBytesAt(value, start - partWidth);
|
|
3775
|
+
if (bytes + partBytes > budget) break;
|
|
3776
|
+
bytes += partBytes;
|
|
3777
|
+
start -= partWidth;
|
|
3778
|
+
}
|
|
3779
|
+
return start;
|
|
3780
|
+
}
|
|
3781
|
+
__name(selectSuffix, "selectSuffix");
|
|
3782
|
+
function copyString(value) {
|
|
3783
|
+
return value.split("").join("");
|
|
3784
|
+
}
|
|
3785
|
+
__name(copyString, "copyString");
|
|
3786
|
+
function truncateJsonStringPayload(value, originalPayloadBytes, payloadBudget, marker) {
|
|
3787
|
+
if (originalPayloadBytes <= payloadBudget) return value;
|
|
3788
|
+
const markerPayloadBytes = jsonStringPayloadByteLength(marker);
|
|
3789
|
+
if (payloadBudget < markerPayloadBytes) {
|
|
3790
|
+
return copyString(value.slice(0, selectPrefix(value, payloadBudget)));
|
|
3791
|
+
}
|
|
3792
|
+
const sourceBudget = payloadBudget - markerPayloadBytes;
|
|
3793
|
+
const headBudget = Math.floor(sourceBudget * 0.2);
|
|
3794
|
+
const tailBudget = sourceBudget - headBudget;
|
|
3795
|
+
const headEnd = selectPrefix(value, headBudget);
|
|
3796
|
+
const tailStart = selectSuffix(value, tailBudget);
|
|
3797
|
+
return copyString(value.slice(0, headEnd)) + marker + copyString(value.slice(tailStart));
|
|
3798
|
+
}
|
|
3799
|
+
__name(truncateJsonStringPayload, "truncateJsonStringPayload");
|
|
3800
|
+
function projectJsonStringToByteBudget(value, jsonByteBudget, marker) {
|
|
3801
|
+
const payloadBudget = Math.max(
|
|
3802
|
+
0,
|
|
3803
|
+
jsonByteBudget - JSON_STRING_DELIMITER_BYTES
|
|
3804
|
+
);
|
|
3805
|
+
const payloadBytes = jsonStringPayloadByteLength(value, payloadBudget);
|
|
3806
|
+
if (payloadBytes <= payloadBudget) return value;
|
|
3807
|
+
const projected = truncateJsonStringPayload(
|
|
3808
|
+
value,
|
|
3809
|
+
payloadBytes,
|
|
3810
|
+
payloadBudget,
|
|
3811
|
+
marker
|
|
3812
|
+
);
|
|
3813
|
+
if (Buffer2.byteLength(JSON.stringify(projected), "utf8") <= jsonByteBudget) {
|
|
3814
|
+
return projected;
|
|
3815
|
+
}
|
|
3816
|
+
const fallback = copyString(
|
|
3817
|
+
marker.slice(0, selectPrefix(marker, payloadBudget))
|
|
3818
|
+
);
|
|
3819
|
+
return Buffer2.byteLength(JSON.stringify(fallback), "utf8") <= jsonByteBudget ? fallback : "";
|
|
3820
|
+
}
|
|
3821
|
+
__name(projectJsonStringToByteBudget, "projectJsonStringToByteBudget");
|
|
3822
|
+
|
|
3823
|
+
export {
|
|
3824
|
+
GITHUB_WORKFLOW_PATHS,
|
|
3825
|
+
SetupGithubError,
|
|
3826
|
+
setupGithub,
|
|
3827
|
+
createTranscriptMessageUpdate,
|
|
3828
|
+
createTranscriptUsageUpdate,
|
|
3829
|
+
BaseEmitter,
|
|
3830
|
+
PlanEmitter,
|
|
3831
|
+
hasFullSessionContext,
|
|
3832
|
+
observeAcpToolResultProjection,
|
|
3833
|
+
observeAcpToolResultWire,
|
|
3834
|
+
observeHeadlessToolResultProjection,
|
|
3835
|
+
observeHeadlessToolResultWire,
|
|
3836
|
+
observeHeadlessJsonToolResultWire,
|
|
3837
|
+
ToolCallEmitter,
|
|
3838
|
+
HistoryReplayer,
|
|
3839
|
+
collectSessionData,
|
|
3840
|
+
normalizeSessionData,
|
|
3841
|
+
toMarkdown,
|
|
3842
|
+
INSIGHT_JS,
|
|
3843
|
+
INSIGHT_CSS,
|
|
3844
|
+
toHtml,
|
|
3845
|
+
toJson,
|
|
3846
|
+
toJsonl,
|
|
3847
|
+
generateExportFilename,
|
|
3848
|
+
JSON_STRING_DELIMITER_BYTES,
|
|
3849
|
+
jsonStringPayloadByteLength,
|
|
3850
|
+
jsonStringJsonByteLength,
|
|
3851
|
+
truncateJsonStringPayload,
|
|
3852
|
+
projectJsonStringToByteBudget
|
|
3853
|
+
};
|
|
3854
|
+
/**
|
|
3855
|
+
* @license
|
|
3856
|
+
* Copyright 2026 Qwen Team
|
|
3857
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
3858
|
+
*/
|
|
3859
|
+
/**
|
|
3860
|
+
* @license
|
|
3861
|
+
* Copyright 2025 Qwen Team
|
|
3862
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
3863
|
+
*/
|
|
3864
|
+
/**
|
|
3865
|
+
* @license
|
|
3866
|
+
* Copyright 2025 Qwen
|
|
3867
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
3868
|
+
*/
|
|
3869
|
+
/**
|
|
3870
|
+
* @license
|
|
3871
|
+
* Copyright 2025 Google LLC
|
|
3872
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
3873
|
+
*/
|
|
3874
|
+
/**
|
|
3875
|
+
* @license
|
|
3876
|
+
* Copyright 2025 Qwen Team
|
|
3877
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
3878
|
+
*
|
|
3879
|
+
* This file is code-generated; do not edit manually.
|
|
3880
|
+
*/
|
|
3881
|
+
/**
|
|
3882
|
+
* @license
|
|
3883
|
+
* Copyright 2025 Qwen Team
|
|
3884
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
3885
|
+
*
|
|
3886
|
+
* This HTML template is code-generated; do not edit manually.
|
|
3887
|
+
*/
|