@antseed/gateway-console 0.1.4 → 0.1.6
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/dist/assets/Activity-CoD1LZfl.js +1 -0
- package/dist/assets/Audit-CNmmoaeN.js +1 -0
- package/dist/assets/ChainGate-CeDu6YYJ.js +1 -0
- package/dist/assets/ChannelClose-C_SM1g28.js +1 -0
- package/dist/assets/{Charts-DAh9h4sf.js → Charts-Dm9j6cVy.js} +1 -1
- package/dist/assets/{Chat-DznobJkE.js → Chat-D1yVH5Y-.js} +4 -4
- package/dist/assets/{ConnectWallet-DSqRjyNA.js → ConnectWallet-phY-Bf7w.js} +1 -1
- package/dist/assets/DataTable-D65CSQpj.js +1 -0
- package/dist/assets/{Disclosure-UjXa2WU7.js → Disclosure-DrGE-NkF.js} +1 -1
- package/dist/assets/{KeyHolder-e5NvqLQn.js → KeyHolder-CmffMcZD.js} +1 -1
- package/dist/assets/{Keys-CxaYteT3.js → Keys-BovEuhch.js} +1 -1
- package/dist/assets/Logs-B-T-V-pM.js +1 -0
- package/dist/assets/Members-tWNaQdIJ.js +1 -0
- package/dist/assets/{Migrate-I3FULNOQ.js → Migrate-IZJLx1xU.js} +1 -1
- package/dist/assets/Models-gJrRx-QV.js +1 -0
- package/dist/assets/OperatorActions-DfjEKPUD.js +1 -0
- package/dist/assets/{OperatorGateAlert-CCPFpK6Y.js → OperatorGateAlert-Bq1ilVp6.js} +1 -1
- package/dist/assets/{Overview-zEyUG_qA.js → Overview-CAxieiTF.js} +1 -1
- package/dist/assets/PeerPicker-JK4q0ZO9.js +1 -0
- package/dist/assets/PolicyEditor-BLo1sheV.js +1 -0
- package/dist/assets/PolicyField-CNEZju4W.js +1 -0
- package/dist/assets/Presets-DBRoMTo4.js +4 -0
- package/dist/assets/Providers-B3qO68z-.js +1 -0
- package/dist/assets/RequestLog-vl46fVIZ.js +1 -0
- package/dist/assets/Rewards-CRiw-wXO.js +2 -0
- package/dist/assets/RewardsClaim-D6P8go-K.js +1 -0
- package/dist/assets/Routing-YpzgjNx_.js +1 -0
- package/dist/assets/{Segmented-Qx6JB6EU.js → Segmented-YOSVapPh.js} +1 -1
- package/dist/assets/SelectField-Cog9tKMb.js +1 -0
- package/dist/assets/{Settings-CvfS7lxA.js → Settings-CSXJvDLz.js} +2 -2
- package/dist/assets/{Switch-Ba56zux7.js → Switch-CGhLd0Ay.js} +1 -1
- package/dist/assets/{Tabs-BmjCmD5T.js → Tabs-DuL015VX.js} +1 -1
- package/dist/assets/TextAreaField-Cxpnr6YH.js +1 -0
- package/dist/assets/{UsageByModel-BBqXiIqo.js → UsageByModel-5QuGhD1d.js} +1 -1
- package/dist/assets/Wallet-BOMYI48H.js +9 -0
- package/dist/assets/WalletConfirm-Dc0AMNYH.js +1 -0
- package/dist/assets/WalletFunding-CsUmR_iR.js +1 -0
- package/dist/assets/WalletSignIn-_VjhsjCt.js +1 -0
- package/dist/assets/Workspaces-Da-rLWlz.js +1 -0
- package/dist/assets/{add-1gRRQJKT.js → add-Btpjkoo6.js} +2 -2
- package/dist/assets/all-wallets-BfrjmkEM.js +6 -0
- package/dist/assets/{app-store-DFWwIQzp.js → app-store-CjAKxMNO.js} +2 -2
- package/dist/assets/{apple-DgwSchgH.js → apple-BcO7LcJZ.js} +2 -2
- package/dist/assets/arrow-bottom-DYhsTHhV.js +8 -0
- package/dist/assets/{arrow-bottom-circle-PbZ344lB.js → arrow-bottom-circle-DH3-k8Pr.js} +2 -2
- package/dist/assets/arrow-left-i-RgLGSY.js +8 -0
- package/dist/assets/arrow-right-Byrj5OIH.js +8 -0
- package/dist/assets/arrow-top-BvEWR8S0.js +8 -0
- package/dist/assets/{bank-wStsFuNb.js → bank-CqGqrPxl.js} +2 -2
- package/dist/assets/{basic-CsVGrHuh.js → basic-DWDkRcdy.js} +1 -1
- package/dist/assets/{browser-DlwffXFC.js → browser-CQNym1bY.js} +2 -2
- package/dist/assets/{bundle-full-sn1k_IQV.js → bundle-full-C55tgBr2.js} +1 -1
- package/dist/assets/{card-pVIbVhmB.js → card-D2zVsWGG.js} +2 -2
- package/dist/assets/ccip-2-SkbDQO.js +1 -0
- package/dist/assets/{checkmark-BpTw56ma.js → checkmark-FRmQx2A8.js} +2 -2
- package/dist/assets/{checkmark-bold-kTaP3XxB.js → checkmark-bold-BQmDzpHv.js} +2 -2
- package/dist/assets/chevron-bottom-iNshLmUE.js +8 -0
- package/dist/assets/chevron-left-DZ-hTSFy.js +8 -0
- package/dist/assets/chevron-right-ftn9B4r7.js +8 -0
- package/dist/assets/chevron-top-nKnnD3BB.js +8 -0
- package/dist/assets/{chrome-store-PaJUtH_w.js → chrome-store-Jvo-YJCr.js} +2 -2
- package/dist/assets/{clock-CMJ0qXc5.js → clock-J68M1oCn.js} +2 -2
- package/dist/assets/close-Bb5jO3su.js +8 -0
- package/dist/assets/{code-block-xCUZ4Wg2.js → code-block-6bmX2qDf.js} +2 -2
- package/dist/assets/coinPlaceholder-BzR2PaE2.js +8 -0
- package/dist/assets/{compass-CGS5aeKg.js → compass-_xiCm8H2.js} +2 -2
- package/dist/assets/{copy-BES3eNqf.js → copy-Cn8HQUQ0.js} +2 -2
- package/dist/assets/{core-Cw7VIz-a.js → core-z96MxYDt.js} +3 -3
- package/dist/assets/cursor-AmgDWaYf.js +3 -0
- package/dist/assets/{cursor-transparent-Dqx5HyjH.js → cursor-transparent-BtLB_SMp.js} +2 -2
- package/dist/assets/{desktop-83z42M8J.js → desktop-BbxKfMA_.js} +2 -2
- package/dist/assets/{disconnect-D49VmdOl.js → disconnect-BLztvIUd.js} +2 -2
- package/dist/assets/{discord-MHKJZWwF.js → discord-CHUWozPc.js} +2 -2
- package/dist/assets/{en_US-Y4ZOVFV4-CzjJ6dvA.js → en_US-Y4ZOVFV4-CAcvlKBB.js} +10 -10
- package/dist/assets/{etherscan-_rlcuy0M.js → etherscan-D5vLd5La.js} +2 -2
- package/dist/assets/{exclamation-triangle-Bw5MhRmd.js → exclamation-triangle-qrQeSTv8.js} +2 -2
- package/dist/assets/{extension-D7frsaxu.js → extension-4gVUPN7H.js} +2 -2
- package/dist/assets/external-link-B14WJWrF.js +8 -0
- package/dist/assets/{facebook-D2S1lToP.js → facebook-CIMBt82S.js} +1 -1
- package/dist/assets/{farcaster-BKD1k1GK.js → farcaster-c2htRu7g.js} +1 -1
- package/dist/assets/filters-Bv71E2AR.js +8 -0
- package/dist/assets/{github-CanBnK1J.js → github-UYR2U4eW.js} +2 -2
- package/dist/assets/{google-DcyjnYXY.js → google-n2NyY3Dw.js} +2 -2
- package/dist/assets/{help-circle-EWFFZOKF.js → help-circle-BLFRE_d4.js} +2 -2
- package/dist/assets/highlighted-body-KQOG7T2V-BPvcfizq.js +1 -0
- package/dist/assets/{id-CwpQkL3B.js → id-Bx-RYygz.js} +2 -2
- package/dist/assets/{image-Bru4L9C0.js → image-BOkMzreg.js} +2 -2
- package/dist/assets/index-BG30WuBG.js +91 -0
- package/dist/assets/index-D8vXwUTI.css +1 -0
- package/dist/assets/{index-DI3oIpGN.js → index-DUGIknuZ.js} +2 -2
- package/dist/assets/{index-BTqmifYb.js → index-DzFVk9QK.js} +1 -1
- package/dist/assets/{index-CO2ldxDL.js → index-FSpcDkTF.js} +3 -3
- package/dist/assets/index-RORHmLec.js +1 -0
- package/dist/assets/{index.es-Dajqanx_.js → index.es-CA2ape1X.js} +4 -4
- package/dist/assets/{info-BiKqTS2d.js → info-Cn0tJEtZ.js} +2 -2
- package/dist/assets/info-circle-Bu4Zfbo-.js +12 -0
- package/dist/assets/{lightbulb-DOHEz8mA.js → lightbulb-CEuGFxl3.js} +2 -2
- package/dist/assets/{limits-DETkh9Vy.js → limits-Cv54gck6.js} +1 -1
- package/dist/assets/{mail-B58fLIk0.js → mail-DTJ1wl6n.js} +1 -1
- package/dist/assets/{mermaid-MCJ5UELQ-CNEVzFUk.js → mermaid-MCJ5UELQ-BedJEojm.js} +6 -6
- package/dist/assets/{metamask-sdk-CgV17tbH.js → metamask-sdk-CQV3kKmz.js} +1 -1
- package/dist/assets/{mobile-Der0Vnyo.js → mobile-D5XkpStI.js} +2 -2
- package/dist/assets/{models-Ben8ko6c.js → models-DMYWCgsM.js} +1 -1
- package/dist/assets/more-DdrXAXX1.js +11 -0
- package/dist/assets/{network-placeholder-DgO-AHV1.js → network-placeholder-DYxULQKf.js} +2 -2
- package/dist/assets/{nftPlaceholder-DQN5ewFX.js → nftPlaceholder-DNCBtU2V.js} +2 -2
- package/dist/assets/off-x6tIm6IU.js +8 -0
- package/dist/assets/{play-store-DGLOVnal.js → play-store-DH_0xG8x.js} +1 -1
- package/dist/assets/{plus-BiSIXTnl.js → plus-D6bTrOQ5.js} +2 -2
- package/dist/assets/{qr-code-CqHp65c8.js → qr-code-nZ-ywovk.js} +1 -1
- package/dist/assets/{recycle-horizontal-CRSsOzCz.js → recycle-horizontal-Dfef9bS8.js} +2 -2
- package/dist/assets/refresh-DjaTupr6.js +8 -0
- package/dist/assets/{reown-logo-DHp9kF6o.js → reown-logo-8xfPxyEW.js} +1 -1
- package/dist/assets/search-CTyg9yLr.js +8 -0
- package/dist/assets/{secp256k1-eRLZxtys.js → secp256k1-C3GZOk0r.js} +1 -1
- package/dist/assets/{send-Ctv_HF2O.js → send-BRCwXyYl.js} +1 -1
- package/dist/assets/{swapHorizontal-zaD-84iv.js → swapHorizontal-DQysA-xv.js} +2 -2
- package/dist/assets/{swapHorizontalBold-f_5MNh3F.js → swapHorizontalBold-CfvpnhxX.js} +2 -2
- package/dist/assets/{swapHorizontalMedium-CnARNDiR.js → swapHorizontalMedium-Ei15IdQU.js} +1 -1
- package/dist/assets/{swapHorizontalRoundedBold-BxdOAjIc.js → swapHorizontalRoundedBold-BrdyV7V9.js} +2 -2
- package/dist/assets/{swapVertical-BS-jDYcd.js → swapVertical-Chu7IZEN.js} +2 -2
- package/dist/assets/{telegram-DfO33sxQ.js → telegram-WX2YRbPh.js} +2 -2
- package/dist/assets/{three-dots-K3AmCfOo.js → three-dots-DxlCOrsx.js} +2 -2
- package/dist/assets/{twitch-DfjpmeLa.js → twitch-DnDwl6Wp.js} +2 -2
- package/dist/assets/{twitterIcon-CXaUDkHK.js → twitterIcon-BRzgYnIv.js} +2 -2
- package/dist/assets/{usage-CjxizGfE.js → usage-CSmvbieU.js} +1 -1
- package/dist/assets/{useInfiniteQuery-Dm7RR6wI.js → useInfiniteQuery-Dd787Fyg.js} +1 -1
- package/dist/assets/{useTx-BRRWrJlB.js → useTx-BMOzJPjG.js} +1 -1
- package/dist/assets/{verify-CplHry9Z.js → verify-BDEQw6N7.js} +2 -2
- package/dist/assets/{verify-filled-CLSOHfSX.js → verify-filled-4pi90YF-.js} +2 -2
- package/dist/assets/{w3m-modal-CQNWLiT9.js → w3m-modal-0lsUnIxD.js} +1 -1
- package/dist/assets/{wallet-C3roxttu.js → wallet-Cdj3wKM9.js} +2 -2
- package/dist/assets/{wallet-placeholder-CC9q2-xU.js → wallet-placeholder-9WrqEYA6.js} +2 -2
- package/dist/assets/{walletconnect-Bnkz4udx.js → walletconnect-Dxw2wfHl.js} +3 -3
- package/dist/assets/warning-circle-BS-8TEUR.js +12 -0
- package/dist/assets/{x-5eg1spDB.js → x-BuEdoHYI.js} +2 -2
- package/dist/index.html +2 -2
- package/package.json +3 -3
- package/dist/assets/Activity-BsmDMcni.js +0 -1
- package/dist/assets/Audit-TIDz29y6.js +0 -1
- package/dist/assets/ChainGate-Dvm-SUef.js +0 -1
- package/dist/assets/ChannelClose-9Lq8KHLH.js +0 -1
- package/dist/assets/DataTable-CDFSD9Kq.js +0 -1
- package/dist/assets/Logs-CNCQTTeZ.js +0 -1
- package/dist/assets/Members-Bme-PLUh.js +0 -1
- package/dist/assets/Models-Bt59XWgD.js +0 -1
- package/dist/assets/OperatorActions-DTrUYN6Z.js +0 -1
- package/dist/assets/PolicyEditor-BdoaX9gK.js +0 -1
- package/dist/assets/PolicyField-DIPl0B1x.js +0 -1
- package/dist/assets/Presets-CoTmwoy_.js +0 -4
- package/dist/assets/Providers-BxpNjH9s.js +0 -1
- package/dist/assets/RequestLog-DhID_VN7.js +0 -1
- package/dist/assets/Rewards-XyWhpm9Z.js +0 -2
- package/dist/assets/RewardsClaim-BSNDTCMG.js +0 -1
- package/dist/assets/Routing-Du8GLQCH.js +0 -1
- package/dist/assets/SelectField-D8fxDUNO.js +0 -1
- package/dist/assets/TextAreaField-CF9_zjuC.js +0 -1
- package/dist/assets/Wallet-DggtuX-0.js +0 -9
- package/dist/assets/WalletConfirm-BQCbOnNv.js +0 -1
- package/dist/assets/WalletFunding-CvDkcGVU.js +0 -1
- package/dist/assets/WalletSignIn-B9g_MY0h.js +0 -1
- package/dist/assets/Workspaces-DUn5iA_D.js +0 -1
- package/dist/assets/all-wallets-vhiMb1eR.js +0 -6
- package/dist/assets/arrow-bottom-Cq4YmOQg.js +0 -8
- package/dist/assets/arrow-left-BLB_Dkvm.js +0 -8
- package/dist/assets/arrow-right-DpKTBsRx.js +0 -8
- package/dist/assets/arrow-top-DSAScZJW.js +0 -8
- package/dist/assets/ccip-DAldItLP.js +0 -1
- package/dist/assets/chevron-bottom-bMFNlOX_.js +0 -8
- package/dist/assets/chevron-left-BvUO5nig.js +0 -8
- package/dist/assets/chevron-right-CsjPzxKK.js +0 -8
- package/dist/assets/chevron-top-k0xp7Can.js +0 -8
- package/dist/assets/close-D_Xc77Yh.js +0 -8
- package/dist/assets/coinPlaceholder-D-kUAKbs.js +0 -8
- package/dist/assets/cursor-BG-gmA3f.js +0 -3
- package/dist/assets/external-link-C7l3-PhY.js +0 -8
- package/dist/assets/filters-LINb1X7z.js +0 -8
- package/dist/assets/highlighted-body-KQOG7T2V-4q_hgdCF.js +0 -1
- package/dist/assets/index-D5ERwHFX.js +0 -1
- package/dist/assets/index-DqdaAEyo.js +0 -91
- package/dist/assets/index-M34IaZVB.css +0 -1
- package/dist/assets/index-mLThkLKM.js +0 -1
- package/dist/assets/info-circle-BBN-kA77.js +0 -12
- package/dist/assets/more-BoKgpjap.js +0 -11
- package/dist/assets/off-M-ZEZL9r.js +0 -8
- package/dist/assets/refresh-CNcLCWXe.js +0 -8
- package/dist/assets/search-Bk2sMNiB.js +0 -8
- package/dist/assets/warning-circle-Be9gSeqg.js +0 -12
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{w as C}from"./core-
|
|
1
|
+
import{w as C}from"./core-z96MxYDt.js";import"./index-BG30WuBG.js";import"./index.es-CA2ape1X.js";import"./events-DQ172AOg.js";import"./en_US-Y4ZOVFV4-CAcvlKBB.js";import"./clsx-B-dksMZM.js";import"./index-BwpQbdIU.js";const g=C`<svg width="22" height="22" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
2
|
<path d="M9.125 6.875C9.125 6.57833 9.21298 6.28832 9.3778 6.04165C9.54262 5.79497 9.77689 5.60271 10.051 5.48918C10.3251 5.37565 10.6267 5.34594 10.9176 5.40382C11.2086 5.4617 11.4759 5.60456 11.6857 5.81434C11.8954 6.02412 12.0383 6.29139 12.0962 6.58236C12.1541 6.87334 12.1244 7.17494 12.0108 7.44903C11.8973 7.72311 11.705 7.95738 11.4584 8.1222C11.2117 8.28703 10.9217 8.375 10.625 8.375C10.2272 8.375 9.84565 8.21696 9.56434 7.93566C9.28304 7.65436 9.125 7.27282 9.125 6.875ZM21.125 11C21.125 13.0025 20.5312 14.9601 19.4186 16.6251C18.3061 18.2902 16.7248 19.5879 14.8747 20.3543C13.0246 21.1206 10.9888 21.3211 9.02471 20.9305C7.06066 20.5398 5.25656 19.5755 3.84055 18.1595C2.42454 16.7435 1.46023 14.9393 1.06955 12.9753C0.678878 11.0112 0.879387 8.97543 1.64572 7.12533C2.41206 5.27523 3.70981 3.69392 5.37486 2.58137C7.0399 1.46882 8.99747 0.875 11 0.875C13.6844 0.877978 16.258 1.94567 18.1562 3.84383C20.0543 5.74199 21.122 8.3156 21.125 11ZM18.875 11C18.875 9.44247 18.4131 7.91992 17.5478 6.62488C16.6825 5.32985 15.4526 4.32049 14.0136 3.72445C12.5747 3.12841 10.9913 2.97246 9.46367 3.27632C7.93607 3.58017 6.53288 4.3302 5.43154 5.43153C4.3302 6.53287 3.58018 7.93606 3.27632 9.46366C2.97246 10.9913 3.12841 12.5747 3.72445 14.0136C4.32049 15.4526 5.32985 16.6825 6.62489 17.5478C7.91993 18.4131 9.44248 18.875 11 18.875C13.0879 18.8728 15.0896 18.0424 16.566 16.566C18.0424 15.0896 18.8728 13.0879 18.875 11ZM12.125 14.4387V11.375C12.125 10.8777 11.9275 10.4008 11.5758 10.0492C11.2242 9.69754 10.7473 9.5 10.25 9.5C9.98433 9.4996 9.72708 9.59325 9.52383 9.76435C9.32058 9.93544 9.18444 10.173 9.13952 10.4348C9.09461 10.6967 9.14381 10.966 9.27843 11.195C9.41304 11.4241 9.62438 11.5981 9.875 11.6863V14.75C9.875 15.2473 10.0725 15.7242 10.4242 16.0758C10.7758 16.4275 11.2527 16.625 11.75 16.625C12.0157 16.6254 12.2729 16.5318 12.4762 16.3607C12.6794 16.1896 12.8156 15.952 12.8605 15.6902C12.9054 15.4283 12.8562 15.159 12.7216 14.93C12.587 14.7009 12.3756 14.5269 12.125 14.4387Z" fill="currentColor"/>
|
|
3
|
-
</svg>`;export{
|
|
3
|
+
</svg>`;export{g as infoSvg};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import{w as o}from"./core-z96MxYDt.js";import"./index-BG30WuBG.js";import"./index.es-CA2ape1X.js";import"./events-DQ172AOg.js";import"./en_US-Y4ZOVFV4-CAcvlKBB.js";import"./clsx-B-dksMZM.js";import"./index-BwpQbdIU.js";const n=o`<svg fill="none" viewBox="0 0 14 15">
|
|
2
|
+
<path
|
|
3
|
+
fill="currentColor"
|
|
4
|
+
d="M6 10.49a1 1 0 1 0 2 0v-2a1 1 0 0 0-2 0v2ZM7 4.49a1 1 0 1 0 0 2 1 1 0 0 0 0-2Z"
|
|
5
|
+
/>
|
|
6
|
+
<path
|
|
7
|
+
fill="currentColor"
|
|
8
|
+
fill-rule="evenodd"
|
|
9
|
+
d="M7 14.99a7 7 0 1 0 0-14 7 7 0 0 0 0 14Zm5-7a5 5 0 1 1-10 0 5 5 0 0 1 10 0Z"
|
|
10
|
+
clip-rule="evenodd"
|
|
11
|
+
/>
|
|
12
|
+
</svg>`;export{n as infoCircleSvg};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{w as C}from"./core-
|
|
1
|
+
import{w as C}from"./core-z96MxYDt.js";import"./index-BG30WuBG.js";import"./index.es-CA2ape1X.js";import"./events-DQ172AOg.js";import"./en_US-Y4ZOVFV4-CAcvlKBB.js";import"./clsx-B-dksMZM.js";import"./index-BwpQbdIU.js";const m=C`<svg width="10" height="10" viewBox="0 0 10 10" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
2
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M5.00177 1.78569C3.8179 1.78569 2.85819 2.74508 2.85819 3.92855C2.85819 4.52287 3.09928 5.05956 3.49077 5.4485L3.5005 5.45817C3.64381 5.60054 3.76515 5.72108 3.85631 5.81845C3.93747 5.90512 4.05255 6.03218 4.12889 6.1805C4.16999 6.26034 4.19 6.30843 4.21768 6.39385C4.22145 6.40546 4.22499 6.41703 4.22833 6.42855H5.77521C5.77854 6.41703 5.78208 6.40547 5.78585 6.39385C5.81353 6.30843 5.83354 6.26034 5.87464 6.1805C5.95098 6.03218 6.06606 5.90512 6.14722 5.81845C6.23839 5.72108 6.35973 5.60053 6.50304 5.45816L6.51276 5.4485C6.90425 5.05956 7.14534 4.52287 7.14534 3.92855C7.14534 2.74508 6.18563 1.78569 5.00177 1.78569ZM5.71629 7.85712H4.28724C4.28724 8.21403 4.28876 8.40985 4.30703 8.54571C4.30727 8.54748 4.30751 8.54921 4.30774 8.55091C4.30944 8.55115 4.31118 8.55138 4.31295 8.55162C4.44884 8.56989 4.64474 8.5714 5.00177 8.5714C5.3588 8.5714 5.55469 8.56989 5.69059 8.55162C5.69236 8.55138 5.69409 8.55115 5.69579 8.55091C5.69603 8.54921 5.69627 8.54748 5.6965 8.54571C5.71477 8.40985 5.71629 8.21403 5.71629 7.85712ZM2.85819 7.14283C2.85819 6.9948 2.85796 6.91114 2.8548 6.85032C2.85461 6.84656 2.85441 6.84309 2.85421 6.83988C2.84393 6.8282 2.83047 6.81334 2.81301 6.79469C2.74172 6.71856 2.63908 6.61643 2.48342 6.46178C1.83307 5.81566 1.42914 4.91859 1.42914 3.92855C1.42914 1.9561 3.02866 0.357117 5.00177 0.357117C6.97487 0.357117 8.57439 1.9561 8.57439 3.92855C8.57439 4.91859 8.17047 5.81566 7.52012 6.46178C7.36445 6.61643 7.26182 6.71856 7.19053 6.79469C7.17306 6.81334 7.1596 6.8282 7.14932 6.83988C7.14912 6.84309 7.14892 6.84656 7.14873 6.85032C7.14557 6.91114 7.14534 6.9948 7.14534 7.14283V7.85712C7.14534 7.87009 7.14535 7.88304 7.14535 7.89598C7.14541 8.19889 7.14547 8.49326 7.11281 8.73606C7.076 9.00978 6.98631 9.32212 6.72678 9.58156C6.46726 9.841 6.15481 9.93065 5.881 9.96745C5.63813 10.0001 5.34365 10 5.04064 9.99998C5.0277 9.99998 5.01474 9.99998 5.00177 9.99998C4.98879 9.99998 4.97583 9.99998 4.96289 9.99998C4.65988 10 4.36541 10.0001 4.12253 9.96745C3.84872 9.93065 3.53628 9.841 3.27675 9.58156C3.01722 9.32212 2.92753 9.00978 2.89072 8.73606C2.85807 8.49326 2.85812 8.19889 2.85818 7.89598C2.85819 7.88304 2.85819 7.87008 2.85819 7.85712V7.14283ZM7.1243 6.86977C7.12366 6.87069 7.1233 6.87116 7.12327 6.87119C7.12323 6.87123 7.12356 6.87076 7.1243 6.86977ZM2.88027 6.8712C2.88025 6.87119 2.87988 6.8707 2.87921 6.86975C2.87995 6.87072 2.88028 6.8712 2.88027 6.8712Z" fill="#949E9E"/>
|
|
3
|
-
</svg>`;export{
|
|
3
|
+
</svg>`;export{m as lightbulbSvg};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as t,
|
|
1
|
+
import{j as t,aq as c,T as u,ar as s,ba as n,bb as f}from"./index-BG30WuBG.js";function g({value:a,onChange:o,idPrefix:e}){return t.jsx("div",{className:"gc-grid gc-grid--4",children:c.map(r=>t.jsx(u,{id:`${e}-${r}`,label:s[r],inputMode:"decimal",placeholder:"No limit",value:a[r],onChange:d=>o({...a,[r]:d.target.value})},r))})}function h(a){return{daily:n(a==null?void 0:a.daily),weekly:n(a==null?void 0:a.weekly),monthly:n(a==null?void 0:a.monthly),total:n(a==null?void 0:a.total)}}function y(a){const o={};for(const e of c)try{o[e]=f(a[e])}catch(r){throw new Error(`${e[0].toUpperCase()}${e.slice(1)} limit: ${r.message}`)}return o}export{g as L,y as d,h as l};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{w as o}from"./core-
|
|
1
|
+
import{w as o}from"./core-z96MxYDt.js";import"./index-BG30WuBG.js";import"./index.es-CA2ape1X.js";import"./events-DQ172AOg.js";import"./en_US-Y4ZOVFV4-CAcvlKBB.js";import"./clsx-B-dksMZM.js";import"./index-BwpQbdIU.js";const v=o`<svg fill="none" viewBox="0 0 16 16">
|
|
2
2
|
<path
|
|
3
3
|
fill="currentColor"
|
|
4
4
|
fill-rule="evenodd"
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/highlighted-body-KQOG7T2V-
|
|
2
|
-
var qp=Object.defineProperty;var jp=Object.getPrototypeOf;var Gp=Reflect.get;var Rl=e=>{throw TypeError(e)};var Vp=(e,t,r)=>t in e?qp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var Ae=(e,t,r)=>Vp(e,typeof t!="symbol"?t+"":t,r),_s=(e,t,r)=>t.has(e)||Rl("Cannot "+r);var ft=(e,t,r)=>(_s(e,t,"read from private field"),r?r.call(e):t.get(e)),Sr=(e,t,r)=>t.has(e)?Rl("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),qt=(e,t,r,n)=>(_s(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),ii=(e,t,r)=>(_s(e,t,"access private method"),r);var Dl=(e,t,r)=>Gp(jp(e),r,t);import{c3 as Z1,r as D,j as I,_ as J1}from"./index-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/highlighted-body-KQOG7T2V-BPvcfizq.js","assets/index-BG30WuBG.js","assets/index-D8vXwUTI.css","assets/bundle-full-C55tgBr2.js","assets/clsx-B-dksMZM.js","assets/Chat-D1yVH5Y-.js","assets/Chat-Dtte195G.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
var qp=Object.defineProperty;var jp=Object.getPrototypeOf;var Gp=Reflect.get;var Rl=e=>{throw TypeError(e)};var Vp=(e,t,r)=>t in e?qp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var Ae=(e,t,r)=>Vp(e,typeof t!="symbol"?t+"":t,r),_s=(e,t,r)=>t.has(e)||Rl("Cannot "+r);var ft=(e,t,r)=>(_s(e,t,"read from private field"),r?r.call(e):t.get(e)),Sr=(e,t,r)=>t.has(e)?Rl("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),qt=(e,t,r,n)=>(_s(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),ii=(e,t,r)=>(_s(e,t,"access private method"),r);var Dl=(e,t,r)=>Gp(jp(e),r,t);import{c3 as Z1,r as D,j as I,cj as Tu,_ as J1}from"./index-BG30WuBG.js";import{b as Yp,c as Wp,a as Xp,f as ts,p as Ol,d as Ml,n as Pl,h as ja,s as Qr,z as eh,e as th,g as rh,i as Qp,j as Bl,w as Kp}from"./bundle-full-C55tgBr2.js";import{c as nh}from"./clsx-B-dksMZM.js";import{t as ah}from"./Chat-D1yVH5Y-.js";const Zp={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},Fl=4294967295;function Jp(e){var t;return!e.sticky&&!((t=e.rawOptions)!=null&&t.strategy)}function Hl(e,t){return{index:e,captureIndices:t.map(r=>r==null?{start:Fl,end:Fl,length:0}:{start:r[0],end:r[1],length:r[1]-r[0]})}}var e2=class{constructor(e,t={}){Ae(this,"patterns");Ae(this,"options");Ae(this,"regexps");Ae(this,"lastSearches");this.patterns=e,this.options=t;const{forgiving:r=!1,cache:n,regexConstructor:a}=t;if(!a)throw new Error("Option `regexConstructor` is not provided");this.regexps=e.map(i=>{if(typeof i!="string")return i;const s=n==null?void 0:n.get(i);if(s){if(s instanceof RegExp)return s;if(r)return null;throw s}try{const u=a(i);return n==null||n.set(i,u),u}catch(u){if(n==null||n.set(i,u),r)return null;throw u}}),this.lastSearches=this.regexps.map(i=>i&&Jp(i)?{strId:0,searchedFrom:0,matchIndex:-1,indices:null}:null)}findNextMatchSync(e,t,r){const n=typeof e=="string"?e:e.content,a=typeof e=="string"?0:e.id||0;let i=-1,s=0,u=null;for(let l=0;l<this.regexps.length;l++){const o=this.regexps[l];if(o)try{const c=a?this.lastSearches[l]:null;let h,f;if(c&&c.strId===a&&c.searchedFrom<=t&&(c.matchIndex===-1||c.matchIndex>=t))h=c.matchIndex,f=c.indices;else{o.lastIndex=t;const p=o.exec(n);h=p?p.index:-1,f=p?p.indices:null,c&&(c.strId=a,c.searchedFrom=t,c.matchIndex=h,c.indices=f)}if(h===-1)continue;if(h===t)return Hl(l,f);(i===-1||h<s)&&(i=l,s=h,u=f)}catch(c){if(this.options.forgiving)continue;throw c}}return i===-1?null:Hl(i,u)}};let t2=0;function r2(e){return{content:e,id:++t2}}function Qn(e){if([...e].length!==1)throw new Error(`Expected "${e}" to be a single code point`);return e.codePointAt(0)}function n2(e,t,r){return e.has(t)||e.set(t,r),e.get(t)}const vu=new Set(["alnum","alpha","ascii","blank","cntrl","digit","graph","lower","print","punct","space","upper","word","xdigit"]),it=String.raw;function Kn(e,t){if(e==null)throw new Error(t??"Value expected");return e}const ih=it`\[\^?`,sh=`c.? | C(?:-.?)?|${it`[pP]\{(?:\^?[-\x20_]*[A-Za-z][-\x20\w]*\})?`}|${it`x[89A-Fa-f]\p{AHex}(?:\\x[89A-Fa-f]\p{AHex})*`}|${it`u(?:\p{AHex}{4})? | x\{[^\}]*\}? | x\p{AHex}{0,2}`}|${it`o\{[^\}]*\}?`}|${it`\d{1,3}`}`,ku=/[?*+][?+]?|\{(?:\d+(?:,\d*)?|,\d+)\}\??/,si=new RegExp(it`
|
|
3
3
|
\\ (?:
|
|
4
4
|
${sh}
|
|
5
5
|
| [gk]<[^>]*>?
|
|
@@ -139,7 +139,7 @@ XID_Continue XIDC
|
|
|
139
139
|
XID_Start XIDS`.split(/\s/).map(e=>[ns(e),e])),u4=new Map([["s",tt(383)],[tt(383),"s"]]),l4=new Map([[tt(223),tt(7838)],[tt(107),tt(8490)],[tt(229),tt(8491)],[tt(969),tt(8486)]]),o4=new Map([Rr(453),Rr(456),Rr(459),Rr(498),...Ds(8072,8079),...Ds(8088,8095),...Ds(8104,8111),Rr(8124),Rr(8140),Rr(8188)]),c4=new Map([["alnum",pe`[\p{Alpha}\p{Nd}]`],["alpha",pe`\p{Alpha}`],["ascii",pe`\p{ASCII}`],["blank",pe`[\p{Zs}\t]`],["cntrl",pe`\p{Cc}`],["digit",pe`\p{Nd}`],["graph",pe`[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]`],["lower",pe`\p{Lower}`],["print",pe`[[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]\p{Zs}]`],["punct",pe`[\p{P}\p{S}]`],["space",pe`\p{space}`],["upper",pe`\p{Upper}`],["word",pe`[\p{Alpha}\p{M}\p{Nd}\p{Pc}]`],["xdigit",pe`\p{AHex}`]]);function h4(e,t){const r=[];for(let n=e;n<=t;n++)r.push(n);return r}function Rr(e){const t=tt(e);return[t.toLowerCase(),t]}function Ds(e,t){return h4(e,t).map(r=>Rr(r))}var Th=new Set(["Lower","Lowercase","Upper","Uppercase","Ll","Lowercase_Letter","Lt","Titlecase_Letter","Lu","Uppercase_Letter"]);function d4(e,t){const r={accuracy:"default",asciiWordBoundaries:!1,avoidSubclass:!1,bestEffortTarget:"ES2025",...t};vh(e);const n={accuracy:r.accuracy,asciiWordBoundaries:r.asciiWordBoundaries,avoidSubclass:r.avoidSubclass,flagDirectivesByAlt:new Map,jsGroupNameMap:new Map,minTargetEs2024:S0(r.bestEffortTarget,"ES2024"),passedLookbehind:!1,strategy:null,subroutineRefMap:new Map,supportedGNodes:new Set,digitIsAscii:e.flags.digitIsAscii,spaceIsAscii:e.flags.spaceIsAscii,wordIsAscii:e.flags.wordIsAscii};Aa(e,f4,n);const a={dotAll:e.flags.dotAll,ignoreCase:e.flags.ignoreCase},i={currentFlags:a,prevFlags:null,globalFlags:a,groupOriginByCopy:new Map,groupsByName:new Map,multiplexCapturesToLeftByRef:new Map,openRefs:new Map,reffedNodesByReferencer:new Map,subroutineRefMap:n.subroutineRefMap};Aa(e,m4,i);const s={groupsByName:i.groupsByName,highestOrphanBackref:0,numCapturesToLeft:0,reffedNodesByReferencer:i.reffedNodesByReferencer};return Aa(e,p4,s),e._originMap=i.groupOriginByCopy,e._strategy=n.strategy,e}var f4={AbsenceFunction({node:e,parent:t,replaceWith:r}){const{body:n,kind:a}=e;if(a==="repeater"){const i=Gt();i.body[0].body.push(cn({negate:!0,body:n}),Fn("Any"));const s=Gt();s.body[0].body.push(fh("greedy",0,1/0,i)),r(Ve(s,t),{traverse:!0})}else throw new Error('Unsupported absence function "(?~|"')},Alternative:{enter({node:e,parent:t,key:r},{flagDirectivesByAlt:n}){const a=e.body.filter(i=>i.kind==="flags");for(let i=r+1;i<t.body.length;i++){const s=t.body[i];Pa(n,s,[]).push(...a)}},exit({node:e},{flagDirectivesByAlt:t}){var r;if((r=t.get(e))!=null&&r.length){const n=wh(t.get(e));if(n){const a=Gt({flags:n});a.body[0].body=e.body,e.body=[Ve(a,e)]}}}},Assertion({node:e,parent:t,key:r,container:n,root:a,remove:i,replaceWith:s},u){const{kind:l,negate:o}=e,{asciiWordBoundaries:c,avoidSubclass:h,supportedGNodes:f,wordIsAscii:p}=u;if(l==="text_segment_boundary")throw new Error(`Unsupported text segment boundary "\\${o?"Y":"y"}"`);if(l==="line_end")s(Ve(cn({body:[xn({body:[k0("string_end")]}),xn({body:[rs(10)]})]}),t));else if(l==="line_start")s(Ve(fr(pe`(?<=\A|\n(?!\z))`,{skipLookbehindValidation:!0}),t));else if(l==="search_start")if(f.has(e))a.flags.sticky=!0,i();else{const b=n[r-1];if(b&&T4(b))s(Ve(cn({negate:!0}),t));else{if(h)throw new Error(pe`Uses "\G" in a way that requires a subclass`);s(Dr(k0("string_start"),t)),u.strategy="clip_search"}}else if(!(l==="string_end"||l==="string_start"))if(l==="string_end_newline")s(Ve(fr(pe`(?=\n?\z)`),t));else if(l==="word_boundary"){if(!p&&!c){const b=`(?:(?<=${dr})(?!${dr})|(?<!${dr})(?=${dr}))`,E=`(?:(?<=${dr})(?=${dr})|(?<!${dr})(?!${dr}))`;s(Ve(fr(o?E:b),t))}}else throw new Error(`Unexpected assertion kind "${l}"`)},Backreference({node:e},{jsGroupNameMap:t}){let{ref:r}=e;typeof r=="string"&&!Ms(r)&&(r=Os(r,t),e.ref=r)},CapturingGroup({node:e},{jsGroupNameMap:t,subroutineRefMap:r}){let{name:n}=e;n&&!Ms(n)&&(n=Os(n,t),e.name=n),r.set(e.number,e),n&&r.set(n,e)},CharacterClassRange({node:e,parent:t,replaceWith:r}){if(t.kind==="intersection"){const n=Ci({body:[e]});r(Ve(n,t),{traverse:!0})}},CharacterSet({node:e,parent:t,replaceWith:r},{accuracy:n,minTargetEs2024:a,digitIsAscii:i,spaceIsAscii:s,wordIsAscii:u}){const{kind:l,negate:o,value:c}=e;if(i&&(l==="digit"||c==="digit")){r(Dr(A0("digit",{negate:o}),t));return}if(s&&(l==="space"||c==="space")){r(Ve(Ps(fr(i4),o),t));return}if(u&&(l==="word"||c==="word")){r(Dr(A0("word",{negate:o}),t));return}if(l==="any")r(Dr(Fn("Any"),t));else if(l==="digit")r(Dr(Fn("Nd",{negate:o}),t));else if(l!=="dot")if(l==="text_segment"){if(n==="strict")throw new Error(pe`Use of "\X" requires non-strict accuracy`);const h="\\p{Emoji}(?:\\p{EMod}|\\uFE0F\\u20E3?|[\\x{E0020}-\\x{E007E}]+\\x{E007F})?",f=pe`\p{RI}{2}|${h}(?:\u200D${h})*`;r(Ve(fr(pe`(?>\r\n|${a?pe`\p{RGI_Emoji}`:f}|\P{M}\p{M}*)`,{skipPropertyNameValidation:!0}),t))}else if(l==="hex")r(Dr(Fn("AHex",{negate:o}),t));else if(l==="newline")r(Ve(fr(o?`[^
|
|
140
140
|
]`:`(?>\r
|
|
141
141
|
?|[
|
|
142
|
-
\v\f
\u2028\u2029])`),t));else if(l==="posix")if(!a&&(c==="graph"||c==="print")){if(n==="strict")throw new Error(`POSIX class "${c}" requires min target ES2024 or non-strict accuracy`);let h={graph:"!-~",print:" -~"}[c];o&&(h=`\0-${tt(h.codePointAt(0)-1)}${tt(h.codePointAt(2)+1)}-`),r(Ve(fr(`[${h}]`),t))}else r(Ve(Ps(fr(c4.get(c)),o),t));else if(l==="property")Au.has(ns(c))||(e.key="sc");else if(l==="space")r(Dr(Fn("space",{negate:o}),t));else if(l==="word")r(Ve(Ps(fr(dr),o),t));else throw new Error(`Unexpected character set kind "${l}"`)},Directive({node:e,parent:t,root:r,remove:n,replaceWith:a,removeAllPrevSiblings:i,removeAllNextSiblings:s}){const{kind:u,flags:l}=e;if(u==="flags")if(!l.enable&&!l.disable)n();else{const o=Gt({flags:l});o.body[0].body=s(),a(Ve(o,t),{traverse:!0})}else if(u==="keep"){const o=r.body[0],h=r.body.length===1&&ch(o,{type:"Group"})&&o.body[0].body.length===1?o.body[0]:r;if(t.parent!==h||h.body.length>1)throw new Error(pe`Uses "\K" in a way that's unsupported`);const f=cn({behind:!0});f.body[0].body=i(),a(Ve(f,t))}else throw new Error(`Unexpected directive kind "${u}"`)},Flags({node:e,parent:t}){if(e.posixIsAscii)throw new Error('Unsupported flag "P"');if(e.textSegmentMode==="word")throw new Error('Unsupported flag "y{w}"');["digitIsAscii","extended","posixIsAscii","spaceIsAscii","wordIsAscii","textSegmentMode"].forEach(r=>delete e[r]),Object.assign(e,{global:!1,hasIndices:!1,multiline:!1,sticky:e.sticky??!1}),t.options={disable:{x:!0,n:!0},force:{v:!0}}},Group({node:e}){if(!e.flags)return;const{enable:t,disable:r}=e.flags;t!=null&&t.extended&&delete t.extended,r!=null&&r.extended&&delete r.extended,t!=null&&t.dotAll&&(r!=null&&r.dotAll)&&delete t.dotAll,t!=null&&t.ignoreCase&&(r!=null&&r.ignoreCase)&&delete t.ignoreCase,t&&!Object.keys(t).length&&delete e.flags.enable,r&&!Object.keys(r).length&&delete e.flags.disable,!e.flags.enable&&!e.flags.disable&&delete e.flags},LookaroundAssertion({node:e},t){const{kind:r}=e;r==="lookbehind"&&(t.passedLookbehind=!0)},NamedCallout({node:e,parent:t,replaceWith:r}){const{kind:n}=e;if(n==="fail")r(Ve(cn({negate:!0}),t));else throw new Error(`Unsupported named callout "(*${n.toUpperCase()}"`)},Quantifier({node:e}){if(e.body.type==="Quantifier"){const t=Gt();t.body[0].body.push(e.body),e.body=Ve(t,e)}},Regex:{enter({node:e},{supportedGNodes:t}){const r=[];let n=!1,a=!1;for(const i of e.body)if(i.body.length===1&&i.body[0].kind==="search_start")i.body.pop();else{const s=Ch(i.body);s?(n=!0,Array.isArray(s)?r.push(...s):r.push(s)):a=!0}n&&!a&&r.forEach(i=>t.add(i))},exit(e,{accuracy:t,passedLookbehind:r,strategy:n}){if(t==="strict"&&r&&n)throw new Error(pe`Uses "\G" in a way that requires non-strict accuracy`)}},Subroutine({node:e},{jsGroupNameMap:t}){let{ref:r}=e;typeof r=="string"&&!Ms(r)&&(r=Os(r,t),e.ref=r)}},m4={Backreference({node:e},{multiplexCapturesToLeftByRef:t,reffedNodesByReferencer:r}){const{orphan:n,ref:a}=e;n||r.set(e,[...t.get(a).map(({node:i})=>i)])},CapturingGroup:{enter({node:e,parent:t,replaceWith:r,skip:n},{groupOriginByCopy:a,groupsByName:i,multiplexCapturesToLeftByRef:s,openRefs:u,reffedNodesByReferencer:l}){const o=a.get(e);if(o&&u.has(e.number)){const h=Dr(to(e.number),t);l.set(h,u.get(e.number)),r(h);return}u.set(e.number,e),s.set(e.number,[]),e.name&&Pa(s,e.name,[]);const c=s.get(e.name??e.number);for(let h=0;h<c.length;h++){const f=c[h];if(o===f.node||o&&o===f.origin||e===f.origin){c.splice(h,1);break}}if(s.get(e.number).push({node:e,origin:o}),e.name&&s.get(e.name).push({node:e,origin:o}),e.name){const h=Pa(i,e.name,new Map);let f=!1;if(o)f=!0;else for(const p of h.values())if(!p.hasDuplicateNameToRemove){f=!0;break}i.get(e.name).set(e,{node:e,hasDuplicateNameToRemove:f})}},exit({node:e},{openRefs:t}){t.get(e.number)===e&&t.delete(e.number)}},Group:{enter({node:e},t){t.prevFlags=t.currentFlags,e.flags&&(t.currentFlags=Mi(t.currentFlags,e.flags))},exit(e,t){t.currentFlags=t.prevFlags}},Subroutine({node:e,parent:t,replaceWith:r},n){const{isRecursive:a,ref:i}=e;if(a){let c=t;for(;(c=c.parent)&&!(c.type==="CapturingGroup"&&(c.name===i||c.number===i)););n.reffedNodesByReferencer.set(e,c);return}const s=n.subroutineRefMap.get(i),u=i===0,l=u?to(0):kh(s,n.groupOriginByCopy,null);let o=l;if(!u){const c=wh(x4(s,f=>f.type==="Group"&&!!f.flags)),h=c?Mi(n.globalFlags,c):n.globalFlags;g4(h,n.currentFlags)||(o=Gt({flags:E4(h)}),o.body[0].body.push(l))}r(Ve(o,t),{traverse:!u})}},p4={Backreference({node:e,parent:t,replaceWith:r},n){if(e.orphan){n.highestOrphanBackref=Math.max(n.highestOrphanBackref,e.ref);return}const i=n.reffedNodesByReferencer.get(e).filter(s=>b4(s,e));if(!i.length)r(Ve(cn({negate:!0}),t));else if(i.length>1){const s=Gt({atomic:!0,body:i.reverse().map(u=>xn({body:[w0(u.number)]}))});r(Ve(s,t))}else e.ref=i[0].number},CapturingGroup({node:e},t){e.number=++t.numCapturesToLeft,e.name&&t.groupsByName.get(e.name).get(e).hasDuplicateNameToRemove&&delete e.name},Regex:{exit({node:e},t){const r=Math.max(t.highestOrphanBackref-t.numCapturesToLeft,0);for(let n=0;n<r;n++){const a=dh();e.body.at(-1).body.push(a)}}},Subroutine({node:e},t){!e.isRecursive||e.ref===0||(e.ref=t.reffedNodesByReferencer.get(e).number)}};function vh(e){Aa(e,{"*"({node:t,parent:r}){t.parent=r}})}function g4(e,t){return e.dotAll===t.dotAll&&e.ignoreCase===t.ignoreCase}function b4(e,t){let r=t;do{if(r.type==="Regex")return!1;if(r.type==="Alternative")continue;if(r===e)return!1;const n=Ah(r.parent);for(const a of n){if(a===r)break;if(a===e||Sh(a,e))return!0}}while(r=r.parent);throw new Error("Unexpected path")}function kh(e,t,r,n){const a=Array.isArray(e)?[]:{};for(const[i,s]of Object.entries(e))i==="parent"?a.parent=Array.isArray(r)?n:r:s&&typeof s=="object"?a[i]=kh(s,t,a,r):(i==="type"&&s==="CapturingGroup"&&t.set(a,t.get(e)??e),a[i]=s);return a}function to(e){const t=mh(e);return t.isRecursive=!0,t}function x4(e,t){const r=[];for(;e=e.parent;)(!t||t(e))&&r.push(e);return r}function Os(e,t){if(t.has(e))return t.get(e);const r=`$${t.size}_${e.replace(/^[^$_\p{IDS}]|[^$\u200C\u200D\p{IDC}]/ug,"_")}`;return t.set(e,r),r}function wh(e){const t=["dotAll","ignoreCase"],r={enable:{},disable:{}};return e.forEach(({flags:n})=>{t.forEach(a=>{var i,s;(i=n.enable)!=null&&i[a]&&(delete r.disable[a],r.enable[a]=!0),(s=n.disable)!=null&&s[a]&&(r.disable[a]=!0)})}),Object.keys(r.enable).length||delete r.enable,Object.keys(r.disable).length||delete r.disable,r.enable||r.disable?r:null}function E4({dotAll:e,ignoreCase:t}){const r={};return(e||t)&&(r.enable={},e&&(r.enable.dotAll=!0),t&&(r.enable.ignoreCase=!0)),(!e||!t)&&(r.disable={},!e&&(r.disable.dotAll=!0),!t&&(r.disable.ignoreCase=!0)),r}function Ah(e){if(!e)throw new Error("Node expected");const{body:t}=e;return Array.isArray(t)?t:t?[t]:null}function Ch(e){const t=e.find(r=>r.kind==="search_start"||v4(r,{negate:!1})||!y4(r));if(!t)return null;if(t.kind==="search_start")return t;if(t.type==="LookaroundAssertion")return t.body[0].body[0];if(t.type==="CapturingGroup"||t.type==="Group"){const r=[];for(const n of t.body){const a=Ch(n.body);if(!a)return null;Array.isArray(a)?r.push(...a):r.push(a)}return r}return null}function Sh(e,t){const r=Ah(e)??[];for(const n of r)if(n===t||Sh(n,t))return!0;return!1}function y4({type:e}){return e==="Assertion"||e==="Directive"||e==="LookaroundAssertion"}function T4(e){const t=["Character","CharacterClass","CharacterSet"];return t.includes(e.type)||e.type==="Quantifier"&&e.min&&t.includes(e.body.type)}function v4(e,t){const r={negate:null,...t};return e.type==="LookaroundAssertion"&&(r.negate===null||e.negate===r.negate)&&e.body.length===1&&ch(e.body[0],{type:"Assertion",kind:"search_start"})}function Ms(e){return/^[$_\p{IDS}][$\u200C\u200D\p{IDC}]*$/u.test(e)}function fr(e,t){const n=hh(e,{...t,unicodePropertyMap:Au}).body;return n.length>1||n[0].body.length>1?Gt({body:n}):n[0].body[0]}function Ps(e,t){return e.negate=t,e}function Dr(e,t){return e.parent=t,e}function Ve(e,t){return vh(e),e.parent=t,e}function k4(e,t){const r=Eh(t),n=S0(r.target,"ES2024"),a=S0(r.target,"ES2025"),i=r.rules.recursionLimit;if(!Number.isInteger(i)||i<2||i>20)throw new Error("Invalid recursionLimit; use 2-20");let s=null,u=null;if(!a){const p=[e.flags.ignoreCase];Aa(e,w4,{getCurrentModI:()=>p.at(-1),popModI(){p.pop()},pushModI(b){p.push(b)},setHasCasedChar(){p.at(-1)?s=!0:u=!0}})}const l={dotAll:e.flags.dotAll,ignoreCase:!!((e.flags.ignoreCase||s)&&!u)};let o=e;const c={accuracy:r.accuracy,appliedGlobalFlags:l,captureMap:new Map,currentFlags:{dotAll:e.flags.dotAll,ignoreCase:e.flags.ignoreCase},inCharClass:!1,lastNode:o,originMap:e._originMap,recursionLimit:i,useAppliedIgnoreCase:!!(!a&&s&&u),useFlagMods:a,useFlagV:n,verbose:r.verbose};function h(p){return c.lastNode=o,o=p,n4(A4[p.type],`Unexpected node type "${p.type}"`)(p,c,h)}const f={pattern:e.body.map(h).join("|"),flags:h(e.flags),options:{...e.options}};return n||(delete f.options.force.v,f.options.disable.v=!0,f.options.unicodeSetsPlugin=null),f._captureTransfers=new Map,f._hiddenCaptures=[],c.captureMap.forEach((p,b)=>{p.hidden&&f._hiddenCaptures.push(b),p.transferTo&&Pa(f._captureTransfers,p.transferTo,[]).push(b)}),f}var w4={"*":{enter({node:e},t){if(no(e)){const r=t.getCurrentModI();t.pushModI(e.flags?Mi({ignoreCase:r},e.flags).ignoreCase:r)}},exit({node:e},t){no(e)&&t.popModI()}},Backreference(e,t){t.setHasCasedChar()},Character({node:e},t){Cu(tt(e.value))&&t.setHasCasedChar()},CharacterClassRange({node:e,skip:t},r){t(),Ih(e,{firstOnly:!0}).length&&r.setHasCasedChar()},CharacterSet({node:e},t){e.kind==="property"&&Th.has(e.value)&&t.setHasCasedChar()}},A4={Alternative({body:e},t,r){return e.map(r).join("")},Assertion({kind:e,negate:t}){if(e==="string_end")return"$";if(e==="string_start")return"^";if(e==="word_boundary")return t?pe`\B`:pe`\b`;throw new Error(`Unexpected assertion kind "${e}"`)},Backreference({ref:e},t){if(typeof e!="number")throw new Error("Unexpected named backref in transformed AST");if(!t.useFlagMods&&t.accuracy==="strict"&&t.currentFlags.ignoreCase&&!t.captureMap.get(e).ignoreCase)throw new Error("Use of case-insensitive backref to case-sensitive group requires target ES2025 or non-strict accuracy");return"\\"+e},CapturingGroup(e,t,r){const{body:n,name:a,number:i}=e,s={ignoreCase:t.currentFlags.ignoreCase},u=t.originMap.get(e);return u&&(s.hidden=!0,i>u.number&&(s.transferTo=u.number)),t.captureMap.set(i,s),`(${a?`?<${a}>`:""}${n.map(r).join("|")})`},Character({value:e},t){const r=tt(e),n=Ln(e,{escDigit:t.lastNode.type==="Backreference",inCharClass:t.inCharClass,useFlagV:t.useFlagV});if(n!==r)return n;if(t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase&&Cu(r)){const a=yh(r);return t.inCharClass?a.join(""):a.length>1?`[${a.join("")}]`:a[0]}return r},CharacterClass(e,t,r){const{kind:n,negate:a,parent:i}=e;let{body:s}=e;if(n==="intersection"&&!t.useFlagV)throw new Error("Use of character class intersection requires min target ES2024");Vt.bugFlagVLiteralHyphenIsRange&&t.useFlagV&&s.some(ao)&&(s=[rs(45),...s.filter(o=>!ao(o))]);const u=()=>`[${a?"^":""}${s.map(r).join(n==="intersection"?"&&":"")}]`;if(!t.inCharClass){if((!t.useFlagV||Vt.bugNestedClassIgnoresNegation)&&!a){const c=s.filter(h=>h.type==="CharacterClass"&&h.kind==="union"&&h.negate);if(c.length){const h=Gt(),f=h.body[0];return h.parent=i,f.parent=h,s=s.filter(p=>!c.includes(p)),e.body=s,s.length?(e.parent=f,f.body.push(e)):h.body.pop(),c.forEach(p=>{const b=xn({body:[p]});p.parent=b,b.parent=h,h.body.push(b)}),r(h)}}t.inCharClass=!0;const o=u();return t.inCharClass=!1,o}const l=s[0];if(n==="union"&&!a&&l&&((!t.useFlagV||!t.verbose)&&i.kind==="union"&&!(Vt.bugFlagVLiteralHyphenIsRange&&t.useFlagV)||!t.verbose&&i.kind==="intersection"&&s.length===1&&l.type!=="CharacterClassRange"))return s.map(r).join("");if(!t.useFlagV&&i.type==="CharacterClass")throw new Error("Uses nested character class in a way that requires min target ES2024");return u()},CharacterClassRange(e,t){const r=e.min.value,n=e.max.value,a={escDigit:!1,inCharClass:!0,useFlagV:t.useFlagV},i=Ln(r,a),s=Ln(n,a),u=new Set;if(t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase){const l=Ih(e);N4(l).forEach(c=>{u.add(Array.isArray(c)?`${Ln(c[0],a)}-${Ln(c[1],a)}`:Ln(c,a))})}return`${i}-${s}${[...u].join("")}`},CharacterSet({kind:e,negate:t,value:r,key:n},a){if(e==="dot")return a.currentFlags.dotAll?a.appliedGlobalFlags.dotAll||a.useFlagMods?".":"[^]":pe`[^\n]`;if(e==="digit")return t?pe`\D`:pe`\d`;if(e==="property"){if(a.useAppliedIgnoreCase&&a.currentFlags.ignoreCase&&Th.has(r))throw new Error(`Unicode property "${r}" can't be case-insensitive when other chars have specific case`);return`${t?pe`\P`:pe`\p`}{${n?`${n}=`:""}${r}}`}if(e==="word")return t?pe`\W`:pe`\w`;throw new Error(`Unexpected character set kind "${e}"`)},Flags(e,t){return(t.appliedGlobalFlags.ignoreCase?"i":"")+(e.dotAll?"s":"")+(e.sticky?"y":"")},Group({atomic:e,body:t,flags:r,parent:n},a,i){const s=a.currentFlags;r&&(a.currentFlags=Mi(s,r));const u=t.map(i).join("|"),l=!a.verbose&&t.length===1&&n.type!=="Quantifier"&&!e&&(!a.useFlagMods||!r)?u:`(?${L4(e,r,a.useFlagMods)}${u})`;return a.currentFlags=s,l},LookaroundAssertion({body:e,kind:t,negate:r},n,a){return`(?${`${t==="lookahead"?"":"<"}${r?"!":"="}`}${e.map(a).join("|")})`},Quantifier(e,t,r){return r(e.body)+R4(e)},Subroutine({isRecursive:e,ref:t},r){if(!e)throw new Error("Unexpected non-recursive subroutine in transformed AST");const n=r.recursionLimit;return t===0?`(?R=${n})`:pe`\g<${t}&R=${n}>`}},C4=new Set(["$","(",")","*","+",".","?","[","\\","]","^","{","|","}"]),S4=new Set(["-","\\","]","^","["]),I4=new Set(["(",")","-","/","[","\\","]","^","{","|","}","!","#","$","%","&","*","+",",",".",":",";","<","=",">","?","@","`","~"]),ro=new Map([[9,pe`\t`],[10,pe`\n`],[11,pe`\v`],[12,pe`\f`],[13,pe`\r`],[8232,pe`\u2028`],[8233,pe`\u2029`],[65279,pe`\uFEFF`]]),_4=new RegExp("^\\p{Cased}$","u");function Cu(e){return _4.test(e)}function Ih(e,t){const r=!!(t!=null&&t.firstOnly),n=e.min.value,a=e.max.value,i=[];if(n<65&&(a===65535||a>=131071)||n===65536&&a>=131071)return i;for(let s=n;s<=a;s++){const u=tt(s);if(!Cu(u))continue;const l=yh(u).filter(o=>{const c=o.codePointAt(0);return c<n||c>a});if(l.length&&(i.push(...l),r))break}return i}function Ln(e,{escDigit:t,inCharClass:r,useFlagV:n}){if(ro.has(e))return ro.get(e);if(e<32||e>126&&e<160||e>262143||t&&D4(e))return e>255?`\\u{${e.toString(16).toUpperCase()}}`:`\\x${e.toString(16).toUpperCase().padStart(2,"0")}`;const a=r?n?I4:S4:C4,i=tt(e);return(a.has(i)?"\\":"")+i}function N4(e){const t=e.map(a=>a.codePointAt(0)).sort((a,i)=>a-i),r=[];let n=null;for(let a=0;a<t.length;a++)t[a+1]===t[a]+1?n??(n=t[a]):n===null?r.push(t[a]):(r.push([n,t[a]]),n=null);return r}function L4(e,t,r){if(e)return">";let n="";if(t&&r){const{enable:a,disable:i}=t;n=(a!=null&&a.ignoreCase?"i":"")+(a!=null&&a.dotAll?"s":"")+(i?"-":"")+(i!=null&&i.ignoreCase?"i":"")+(i!=null&&i.dotAll?"s":"")}return`${n}:`}function R4({kind:e,max:t,min:r}){let n;return!r&&t===1?n="?":!r&&t===1/0?n="*":r===1&&t===1/0?n="+":r===t?n=`{${r}}`:n=`{${r},${t===1/0?"":t}}`,n+{greedy:"",lazy:"?",possessive:"+"}[e]}function no({type:e}){return e==="CapturingGroup"||e==="Group"||e==="LookaroundAssertion"}function D4(e){return e>47&&e<58}function ao({type:e,value:t}){return e==="Character"&&t===45}var Fr,gr,mn,Hr,pn,qa,I0,qr,O4=(qr=class extends RegExp{constructor(r,n,a){var t=(...MS)=>(super(...MS),Sr(this,qa),Sr(this,Fr,new Map),Sr(this,gr,null),Sr(this,mn),Sr(this,Hr,null),Sr(this,pn,null),Ae(this,"rawOptions",{}),this);const i=!!(a!=null&&a.lazyCompile);if(r instanceof RegExp){if(a)throw new Error("Cannot provide options when copying a regexp");const s=r;t(s,n),qt(this,mn,s.source),s instanceof qr&&(qt(this,Fr,ft(s,Fr)),qt(this,Hr,ft(s,Hr)),qt(this,pn,ft(s,pn)),this.rawOptions=s.rawOptions)}else{const s={hiddenCaptures:[],strategy:null,transfers:[],...a};t(i?"":r,n),qt(this,mn,r),qt(this,Fr,P4(s.hiddenCaptures,s.transfers)),qt(this,pn,s.strategy),this.rawOptions=a??{}}i||qt(this,gr,this)}get source(){return ft(this,mn)||"(?:)"}exec(r){if(!ft(this,gr)){const{lazyCompile:i,...s}=this.rawOptions;qt(this,gr,new qr(ft(this,mn),this.flags,s))}const n=this.global||this.sticky,a=this.lastIndex;if(ft(this,pn)==="clip_search"&&n&&a){this.lastIndex=0;const i=ii(this,qa,I0).call(this,r.slice(a));return i&&(M4(i,a,r,this.hasIndices),this.lastIndex+=a),i}return ii(this,qa,I0).call(this,r)}},Fr=new WeakMap,gr=new WeakMap,mn=new WeakMap,Hr=new WeakMap,pn=new WeakMap,qa=new WeakSet,I0=function(r){ft(this,gr).lastIndex=this.lastIndex;const n=Dl(qr.prototype,this,"exec").call(ft(this,gr),r);if(this.lastIndex=ft(this,gr).lastIndex,!n||!ft(this,Fr).size)return n;const a=[...n];n.length=1;let i;this.hasIndices&&(i=[...n.indices],n.indices.length=1);const s=[0];for(let u=1;u<a.length;u++){const{hidden:l,transferTo:o}=ft(this,Fr).get(u)??{};if(l?s.push(null):(s.push(n.length),n.push(a[u]),this.hasIndices&&n.indices.push(i[u])),o&&a[u]!==void 0){const c=s[o];if(!c)throw new Error(`Invalid capture transfer to "${c}"`);if(n[c]=a[u],this.hasIndices&&(n.indices[c]=i[u]),n.groups){ft(this,Hr)||qt(this,Hr,B4(this.source));const h=ft(this,Hr).get(o);h&&(n.groups[h]=a[u],this.hasIndices&&(n.indices.groups[h]=i[u]))}}}return n},qr);function M4(e,t,r,n){if(e.index+=t,e.input=r,n){const a=e.indices;for(let s=0;s<a.length;s++){const u=a[s];u&&(a[s]=[u[0]+t,u[1]+t])}const i=a.groups;i&&Object.keys(i).forEach(s=>{const u=i[s];u&&(i[s]=[u[0]+t,u[1]+t])})}}function P4(e,t){const r=new Map;for(const n of e)r.set(n,{hidden:!0});for(const[n,a]of t)for(const i of a)Pa(r,i,{}).transferTo=n;return r}function B4(e){const t=/(?<capture>\((?:\?<(?![=!])(?<name>[^>]+)>|(?!\?)))|\\?./gsu,r=new Map;let n=0,a=0,i;for(;i=t.exec(e);){const{0:s,groups:{capture:u,name:l}}=i;s==="["?n++:n?s==="]"&&n--:u&&(a++,l&&r.set(a,l))}return r}function F4(e,t){const r=H4(e,t);return r.options?new O4(r.pattern,r.flags,r.options):new RegExp(r.pattern,r.flags)}function H4(e,t){const r=Eh(t),n=hh(e,{flags:r.flags,normalizeUnknownPropertyNames:!0,rules:{captureGroup:r.rules.captureGroup,singleline:r.rules.singleline},skipBackrefValidation:r.rules.allowOrphanBackrefs,unicodePropertyMap:Au}),a=d4(n,{accuracy:r.accuracy,asciiWordBoundaries:r.rules.asciiWordBoundaries,avoidSubclass:r.avoidSubclass,bestEffortTarget:r.target}),i=k4(a,r),s=t4(i.pattern,{captureTransfers:i._captureTransfers,hiddenCaptures:i._hiddenCaptures,mode:"external"}),u=J2(s.pattern),l=Z2(u.pattern,{captureTransfers:s.captureTransfers,hiddenCaptures:s.hiddenCaptures}),o={pattern:l.pattern,flags:`${r.hasIndices?"d":""}${r.global?"g":""}${i.flags}${i.options.disable.v?"u":"v"}`};if(r.avoidSubclass){if(r.lazyCompileLength!==1/0)throw new Error("Lazy compilation requires subclass")}else{const c=l.hiddenCaptures.sort((b,E)=>b-E),h=Array.from(l.captureTransfers),f=a._strategy,p=o.pattern.length>=r.lazyCompileLength;(c.length||h.length||f||p)&&(o.options={...c.length&&{hiddenCaptures:c},...h.length&&{transfers:h},...f&&{strategy:f},...p&&{lazyCompile:p}})}return o}function z4(e,t){return F4(e,{global:!0,hasIndices:!0,lazyCompileLength:3e3,rules:{allowOrphanBackrefs:!0,asciiWordBoundaries:!0,captureGroup:!0,recursionLimit:5,singleline:!0},...t})}function $4(e={}){const t={target:"auto",cache:new Map,...e};return t.regexConstructor||(t.regexConstructor=r=>z4(r,{target:t.target})),{createScanner(r){return new e2(r,t)},createString:r2}}var U4=$4({forgiving:!0}),q4=Object.fromEntries(Xp.flatMap(e=>{var t;return((t=e.aliases)!=null?t:[]).map(r=>[r,e.id])})),Si=new Set(Object.keys(Yp)),io=e=>{let t=e.trim().toLowerCase();return q4[t]||(Si.has(t),t)},Bs=new Map,j4=3e5,G4=5e3,V4=64,Er=new Map,_0=0,Y4=(e,t)=>{let r=t.tokens.length+Math.ceil(e.length/V4);for(let n of t.tokens)r+=n.length;return r},so=e=>{let t=Er.get(e);return t&&(Er.delete(e),Er.set(e,t)),t==null?void 0:t.result},uo=e=>{let t=Er.get(e);t&&(Er.delete(e),_0-=t.cost)},W4=(e,t)=>{uo(e);let r=Y4(e,t);for(Er.set(e,{cost:r,result:t}),_0+=r;(_0>j4||Er.size>G4)&&Er.size>1;)uo(Er.keys().next().value)},N0=new Map,X4=4,Q4=(e,t)=>{let r=N0.get(e);if(!r)return;let n=r.findIndex(a=>t.startsWith(a.prefix));return n===-1?void 0:r.splice(n,1)[0]},lo=(e,t)=>{let r=N0.get(e);r||(r=[],N0.set(e,r)),r.unshift(t),r.length>X4&&r.pop()},oo=(e,t)=>{if(t!==0)for(let r of e)for(let n of r)n.offset+=t},K4=(e,t,r,n,a)=>{let i=Q4(r,t),s=i?i.prefix:"",u=i?i.rows:[],l=i==null?void 0:i.grammarState,o=t.lastIndexOf(`
|
|
142
|
+
\v\f
\u2028\u2029])`),t));else if(l==="posix")if(!a&&(c==="graph"||c==="print")){if(n==="strict")throw new Error(`POSIX class "${c}" requires min target ES2024 or non-strict accuracy`);let h={graph:"!-~",print:" -~"}[c];o&&(h=`\0-${tt(h.codePointAt(0)-1)}${tt(h.codePointAt(2)+1)}-`),r(Ve(fr(`[${h}]`),t))}else r(Ve(Ps(fr(c4.get(c)),o),t));else if(l==="property")Au.has(ns(c))||(e.key="sc");else if(l==="space")r(Dr(Fn("space",{negate:o}),t));else if(l==="word")r(Ve(Ps(fr(dr),o),t));else throw new Error(`Unexpected character set kind "${l}"`)},Directive({node:e,parent:t,root:r,remove:n,replaceWith:a,removeAllPrevSiblings:i,removeAllNextSiblings:s}){const{kind:u,flags:l}=e;if(u==="flags")if(!l.enable&&!l.disable)n();else{const o=Gt({flags:l});o.body[0].body=s(),a(Ve(o,t),{traverse:!0})}else if(u==="keep"){const o=r.body[0],h=r.body.length===1&&ch(o,{type:"Group"})&&o.body[0].body.length===1?o.body[0]:r;if(t.parent!==h||h.body.length>1)throw new Error(pe`Uses "\K" in a way that's unsupported`);const f=cn({behind:!0});f.body[0].body=i(),a(Ve(f,t))}else throw new Error(`Unexpected directive kind "${u}"`)},Flags({node:e,parent:t}){if(e.posixIsAscii)throw new Error('Unsupported flag "P"');if(e.textSegmentMode==="word")throw new Error('Unsupported flag "y{w}"');["digitIsAscii","extended","posixIsAscii","spaceIsAscii","wordIsAscii","textSegmentMode"].forEach(r=>delete e[r]),Object.assign(e,{global:!1,hasIndices:!1,multiline:!1,sticky:e.sticky??!1}),t.options={disable:{x:!0,n:!0},force:{v:!0}}},Group({node:e}){if(!e.flags)return;const{enable:t,disable:r}=e.flags;t!=null&&t.extended&&delete t.extended,r!=null&&r.extended&&delete r.extended,t!=null&&t.dotAll&&(r!=null&&r.dotAll)&&delete t.dotAll,t!=null&&t.ignoreCase&&(r!=null&&r.ignoreCase)&&delete t.ignoreCase,t&&!Object.keys(t).length&&delete e.flags.enable,r&&!Object.keys(r).length&&delete e.flags.disable,!e.flags.enable&&!e.flags.disable&&delete e.flags},LookaroundAssertion({node:e},t){const{kind:r}=e;r==="lookbehind"&&(t.passedLookbehind=!0)},NamedCallout({node:e,parent:t,replaceWith:r}){const{kind:n}=e;if(n==="fail")r(Ve(cn({negate:!0}),t));else throw new Error(`Unsupported named callout "(*${n.toUpperCase()}"`)},Quantifier({node:e}){if(e.body.type==="Quantifier"){const t=Gt();t.body[0].body.push(e.body),e.body=Ve(t,e)}},Regex:{enter({node:e},{supportedGNodes:t}){const r=[];let n=!1,a=!1;for(const i of e.body)if(i.body.length===1&&i.body[0].kind==="search_start")i.body.pop();else{const s=Ch(i.body);s?(n=!0,Array.isArray(s)?r.push(...s):r.push(s)):a=!0}n&&!a&&r.forEach(i=>t.add(i))},exit(e,{accuracy:t,passedLookbehind:r,strategy:n}){if(t==="strict"&&r&&n)throw new Error(pe`Uses "\G" in a way that requires non-strict accuracy`)}},Subroutine({node:e},{jsGroupNameMap:t}){let{ref:r}=e;typeof r=="string"&&!Ms(r)&&(r=Os(r,t),e.ref=r)}},m4={Backreference({node:e},{multiplexCapturesToLeftByRef:t,reffedNodesByReferencer:r}){const{orphan:n,ref:a}=e;n||r.set(e,[...t.get(a).map(({node:i})=>i)])},CapturingGroup:{enter({node:e,parent:t,replaceWith:r,skip:n},{groupOriginByCopy:a,groupsByName:i,multiplexCapturesToLeftByRef:s,openRefs:u,reffedNodesByReferencer:l}){const o=a.get(e);if(o&&u.has(e.number)){const h=Dr(to(e.number),t);l.set(h,u.get(e.number)),r(h);return}u.set(e.number,e),s.set(e.number,[]),e.name&&Pa(s,e.name,[]);const c=s.get(e.name??e.number);for(let h=0;h<c.length;h++){const f=c[h];if(o===f.node||o&&o===f.origin||e===f.origin){c.splice(h,1);break}}if(s.get(e.number).push({node:e,origin:o}),e.name&&s.get(e.name).push({node:e,origin:o}),e.name){const h=Pa(i,e.name,new Map);let f=!1;if(o)f=!0;else for(const p of h.values())if(!p.hasDuplicateNameToRemove){f=!0;break}i.get(e.name).set(e,{node:e,hasDuplicateNameToRemove:f})}},exit({node:e},{openRefs:t}){t.get(e.number)===e&&t.delete(e.number)}},Group:{enter({node:e},t){t.prevFlags=t.currentFlags,e.flags&&(t.currentFlags=Mi(t.currentFlags,e.flags))},exit(e,t){t.currentFlags=t.prevFlags}},Subroutine({node:e,parent:t,replaceWith:r},n){const{isRecursive:a,ref:i}=e;if(a){let c=t;for(;(c=c.parent)&&!(c.type==="CapturingGroup"&&(c.name===i||c.number===i)););n.reffedNodesByReferencer.set(e,c);return}const s=n.subroutineRefMap.get(i),u=i===0,l=u?to(0):kh(s,n.groupOriginByCopy,null);let o=l;if(!u){const c=wh(x4(s,f=>f.type==="Group"&&!!f.flags)),h=c?Mi(n.globalFlags,c):n.globalFlags;g4(h,n.currentFlags)||(o=Gt({flags:E4(h)}),o.body[0].body.push(l))}r(Ve(o,t),{traverse:!u})}},p4={Backreference({node:e,parent:t,replaceWith:r},n){if(e.orphan){n.highestOrphanBackref=Math.max(n.highestOrphanBackref,e.ref);return}const i=n.reffedNodesByReferencer.get(e).filter(s=>b4(s,e));if(!i.length)r(Ve(cn({negate:!0}),t));else if(i.length>1){const s=Gt({atomic:!0,body:i.reverse().map(u=>xn({body:[w0(u.number)]}))});r(Ve(s,t))}else e.ref=i[0].number},CapturingGroup({node:e},t){e.number=++t.numCapturesToLeft,e.name&&t.groupsByName.get(e.name).get(e).hasDuplicateNameToRemove&&delete e.name},Regex:{exit({node:e},t){const r=Math.max(t.highestOrphanBackref-t.numCapturesToLeft,0);for(let n=0;n<r;n++){const a=dh();e.body.at(-1).body.push(a)}}},Subroutine({node:e},t){!e.isRecursive||e.ref===0||(e.ref=t.reffedNodesByReferencer.get(e).number)}};function vh(e){Aa(e,{"*"({node:t,parent:r}){t.parent=r}})}function g4(e,t){return e.dotAll===t.dotAll&&e.ignoreCase===t.ignoreCase}function b4(e,t){let r=t;do{if(r.type==="Regex")return!1;if(r.type==="Alternative")continue;if(r===e)return!1;const n=Ah(r.parent);for(const a of n){if(a===r)break;if(a===e||Sh(a,e))return!0}}while(r=r.parent);throw new Error("Unexpected path")}function kh(e,t,r,n){const a=Array.isArray(e)?[]:{};for(const[i,s]of Object.entries(e))i==="parent"?a.parent=Array.isArray(r)?n:r:s&&typeof s=="object"?a[i]=kh(s,t,a,r):(i==="type"&&s==="CapturingGroup"&&t.set(a,t.get(e)??e),a[i]=s);return a}function to(e){const t=mh(e);return t.isRecursive=!0,t}function x4(e,t){const r=[];for(;e=e.parent;)(!t||t(e))&&r.push(e);return r}function Os(e,t){if(t.has(e))return t.get(e);const r=`$${t.size}_${e.replace(/^[^$_\p{IDS}]|[^$\u200C\u200D\p{IDC}]/ug,"_")}`;return t.set(e,r),r}function wh(e){const t=["dotAll","ignoreCase"],r={enable:{},disable:{}};return e.forEach(({flags:n})=>{t.forEach(a=>{var i,s;(i=n.enable)!=null&&i[a]&&(delete r.disable[a],r.enable[a]=!0),(s=n.disable)!=null&&s[a]&&(r.disable[a]=!0)})}),Object.keys(r.enable).length||delete r.enable,Object.keys(r.disable).length||delete r.disable,r.enable||r.disable?r:null}function E4({dotAll:e,ignoreCase:t}){const r={};return(e||t)&&(r.enable={},e&&(r.enable.dotAll=!0),t&&(r.enable.ignoreCase=!0)),(!e||!t)&&(r.disable={},!e&&(r.disable.dotAll=!0),!t&&(r.disable.ignoreCase=!0)),r}function Ah(e){if(!e)throw new Error("Node expected");const{body:t}=e;return Array.isArray(t)?t:t?[t]:null}function Ch(e){const t=e.find(r=>r.kind==="search_start"||v4(r,{negate:!1})||!y4(r));if(!t)return null;if(t.kind==="search_start")return t;if(t.type==="LookaroundAssertion")return t.body[0].body[0];if(t.type==="CapturingGroup"||t.type==="Group"){const r=[];for(const n of t.body){const a=Ch(n.body);if(!a)return null;Array.isArray(a)?r.push(...a):r.push(a)}return r}return null}function Sh(e,t){const r=Ah(e)??[];for(const n of r)if(n===t||Sh(n,t))return!0;return!1}function y4({type:e}){return e==="Assertion"||e==="Directive"||e==="LookaroundAssertion"}function T4(e){const t=["Character","CharacterClass","CharacterSet"];return t.includes(e.type)||e.type==="Quantifier"&&e.min&&t.includes(e.body.type)}function v4(e,t){const r={negate:null,...t};return e.type==="LookaroundAssertion"&&(r.negate===null||e.negate===r.negate)&&e.body.length===1&&ch(e.body[0],{type:"Assertion",kind:"search_start"})}function Ms(e){return/^[$_\p{IDS}][$\u200C\u200D\p{IDC}]*$/u.test(e)}function fr(e,t){const n=hh(e,{...t,unicodePropertyMap:Au}).body;return n.length>1||n[0].body.length>1?Gt({body:n}):n[0].body[0]}function Ps(e,t){return e.negate=t,e}function Dr(e,t){return e.parent=t,e}function Ve(e,t){return vh(e),e.parent=t,e}function k4(e,t){const r=Eh(t),n=S0(r.target,"ES2024"),a=S0(r.target,"ES2025"),i=r.rules.recursionLimit;if(!Number.isInteger(i)||i<2||i>20)throw new Error("Invalid recursionLimit; use 2-20");let s=null,u=null;if(!a){const p=[e.flags.ignoreCase];Aa(e,w4,{getCurrentModI:()=>p.at(-1),popModI(){p.pop()},pushModI(b){p.push(b)},setHasCasedChar(){p.at(-1)?s=!0:u=!0}})}const l={dotAll:e.flags.dotAll,ignoreCase:!!((e.flags.ignoreCase||s)&&!u)};let o=e;const c={accuracy:r.accuracy,appliedGlobalFlags:l,captureMap:new Map,currentFlags:{dotAll:e.flags.dotAll,ignoreCase:e.flags.ignoreCase},inCharClass:!1,lastNode:o,originMap:e._originMap,recursionLimit:i,useAppliedIgnoreCase:!!(!a&&s&&u),useFlagMods:a,useFlagV:n,verbose:r.verbose};function h(p){return c.lastNode=o,o=p,n4(A4[p.type],`Unexpected node type "${p.type}"`)(p,c,h)}const f={pattern:e.body.map(h).join("|"),flags:h(e.flags),options:{...e.options}};return n||(delete f.options.force.v,f.options.disable.v=!0,f.options.unicodeSetsPlugin=null),f._captureTransfers=new Map,f._hiddenCaptures=[],c.captureMap.forEach((p,b)=>{p.hidden&&f._hiddenCaptures.push(b),p.transferTo&&Pa(f._captureTransfers,p.transferTo,[]).push(b)}),f}var w4={"*":{enter({node:e},t){if(no(e)){const r=t.getCurrentModI();t.pushModI(e.flags?Mi({ignoreCase:r},e.flags).ignoreCase:r)}},exit({node:e},t){no(e)&&t.popModI()}},Backreference(e,t){t.setHasCasedChar()},Character({node:e},t){Cu(tt(e.value))&&t.setHasCasedChar()},CharacterClassRange({node:e,skip:t},r){t(),Ih(e,{firstOnly:!0}).length&&r.setHasCasedChar()},CharacterSet({node:e},t){e.kind==="property"&&Th.has(e.value)&&t.setHasCasedChar()}},A4={Alternative({body:e},t,r){return e.map(r).join("")},Assertion({kind:e,negate:t}){if(e==="string_end")return"$";if(e==="string_start")return"^";if(e==="word_boundary")return t?pe`\B`:pe`\b`;throw new Error(`Unexpected assertion kind "${e}"`)},Backreference({ref:e},t){if(typeof e!="number")throw new Error("Unexpected named backref in transformed AST");if(!t.useFlagMods&&t.accuracy==="strict"&&t.currentFlags.ignoreCase&&!t.captureMap.get(e).ignoreCase)throw new Error("Use of case-insensitive backref to case-sensitive group requires target ES2025 or non-strict accuracy");return"\\"+e},CapturingGroup(e,t,r){const{body:n,name:a,number:i}=e,s={ignoreCase:t.currentFlags.ignoreCase},u=t.originMap.get(e);return u&&(s.hidden=!0,i>u.number&&(s.transferTo=u.number)),t.captureMap.set(i,s),`(${a?`?<${a}>`:""}${n.map(r).join("|")})`},Character({value:e},t){const r=tt(e),n=Ln(e,{escDigit:t.lastNode.type==="Backreference",inCharClass:t.inCharClass,useFlagV:t.useFlagV});if(n!==r)return n;if(t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase&&Cu(r)){const a=yh(r);return t.inCharClass?a.join(""):a.length>1?`[${a.join("")}]`:a[0]}return r},CharacterClass(e,t,r){const{kind:n,negate:a,parent:i}=e;let{body:s}=e;if(n==="intersection"&&!t.useFlagV)throw new Error("Use of character class intersection requires min target ES2024");Vt.bugFlagVLiteralHyphenIsRange&&t.useFlagV&&s.some(ao)&&(s=[rs(45),...s.filter(o=>!ao(o))]);const u=()=>`[${a?"^":""}${s.map(r).join(n==="intersection"?"&&":"")}]`;if(!t.inCharClass){if((!t.useFlagV||Vt.bugNestedClassIgnoresNegation)&&!a){const c=s.filter(h=>h.type==="CharacterClass"&&h.kind==="union"&&h.negate);if(c.length){const h=Gt(),f=h.body[0];return h.parent=i,f.parent=h,s=s.filter(p=>!c.includes(p)),e.body=s,s.length?(e.parent=f,f.body.push(e)):h.body.pop(),c.forEach(p=>{const b=xn({body:[p]});p.parent=b,b.parent=h,h.body.push(b)}),r(h)}}t.inCharClass=!0;const o=u();return t.inCharClass=!1,o}const l=s[0];if(n==="union"&&!a&&l&&((!t.useFlagV||!t.verbose)&&i.kind==="union"&&!(Vt.bugFlagVLiteralHyphenIsRange&&t.useFlagV)||!t.verbose&&i.kind==="intersection"&&s.length===1&&l.type!=="CharacterClassRange"))return s.map(r).join("");if(!t.useFlagV&&i.type==="CharacterClass")throw new Error("Uses nested character class in a way that requires min target ES2024");return u()},CharacterClassRange(e,t){const r=e.min.value,n=e.max.value,a={escDigit:!1,inCharClass:!0,useFlagV:t.useFlagV},i=Ln(r,a),s=Ln(n,a),u=new Set;if(t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase){const l=Ih(e);N4(l).forEach(c=>{u.add(Array.isArray(c)?`${Ln(c[0],a)}-${Ln(c[1],a)}`:Ln(c,a))})}return`${i}-${s}${[...u].join("")}`},CharacterSet({kind:e,negate:t,value:r,key:n},a){if(e==="dot")return a.currentFlags.dotAll?a.appliedGlobalFlags.dotAll||a.useFlagMods?".":"[^]":pe`[^\n]`;if(e==="digit")return t?pe`\D`:pe`\d`;if(e==="property"){if(a.useAppliedIgnoreCase&&a.currentFlags.ignoreCase&&Th.has(r))throw new Error(`Unicode property "${r}" can't be case-insensitive when other chars have specific case`);return`${t?pe`\P`:pe`\p`}{${n?`${n}=`:""}${r}}`}if(e==="word")return t?pe`\W`:pe`\w`;throw new Error(`Unexpected character set kind "${e}"`)},Flags(e,t){return(t.appliedGlobalFlags.ignoreCase?"i":"")+(e.dotAll?"s":"")+(e.sticky?"y":"")},Group({atomic:e,body:t,flags:r,parent:n},a,i){const s=a.currentFlags;r&&(a.currentFlags=Mi(s,r));const u=t.map(i).join("|"),l=!a.verbose&&t.length===1&&n.type!=="Quantifier"&&!e&&(!a.useFlagMods||!r)?u:`(?${L4(e,r,a.useFlagMods)}${u})`;return a.currentFlags=s,l},LookaroundAssertion({body:e,kind:t,negate:r},n,a){return`(?${`${t==="lookahead"?"":"<"}${r?"!":"="}`}${e.map(a).join("|")})`},Quantifier(e,t,r){return r(e.body)+R4(e)},Subroutine({isRecursive:e,ref:t},r){if(!e)throw new Error("Unexpected non-recursive subroutine in transformed AST");const n=r.recursionLimit;return t===0?`(?R=${n})`:pe`\g<${t}&R=${n}>`}},C4=new Set(["$","(",")","*","+",".","?","[","\\","]","^","{","|","}"]),S4=new Set(["-","\\","]","^","["]),I4=new Set(["(",")","-","/","[","\\","]","^","{","|","}","!","#","$","%","&","*","+",",",".",":",";","<","=",">","?","@","`","~"]),ro=new Map([[9,pe`\t`],[10,pe`\n`],[11,pe`\v`],[12,pe`\f`],[13,pe`\r`],[8232,pe`\u2028`],[8233,pe`\u2029`],[65279,pe`\uFEFF`]]),_4=new RegExp("^\\p{Cased}$","u");function Cu(e){return _4.test(e)}function Ih(e,t){const r=!!(t!=null&&t.firstOnly),n=e.min.value,a=e.max.value,i=[];if(n<65&&(a===65535||a>=131071)||n===65536&&a>=131071)return i;for(let s=n;s<=a;s++){const u=tt(s);if(!Cu(u))continue;const l=yh(u).filter(o=>{const c=o.codePointAt(0);return c<n||c>a});if(l.length&&(i.push(...l),r))break}return i}function Ln(e,{escDigit:t,inCharClass:r,useFlagV:n}){if(ro.has(e))return ro.get(e);if(e<32||e>126&&e<160||e>262143||t&&D4(e))return e>255?`\\u{${e.toString(16).toUpperCase()}}`:`\\x${e.toString(16).toUpperCase().padStart(2,"0")}`;const a=r?n?I4:S4:C4,i=tt(e);return(a.has(i)?"\\":"")+i}function N4(e){const t=e.map(a=>a.codePointAt(0)).sort((a,i)=>a-i),r=[];let n=null;for(let a=0;a<t.length;a++)t[a+1]===t[a]+1?n??(n=t[a]):n===null?r.push(t[a]):(r.push([n,t[a]]),n=null);return r}function L4(e,t,r){if(e)return">";let n="";if(t&&r){const{enable:a,disable:i}=t;n=(a!=null&&a.ignoreCase?"i":"")+(a!=null&&a.dotAll?"s":"")+(i?"-":"")+(i!=null&&i.ignoreCase?"i":"")+(i!=null&&i.dotAll?"s":"")}return`${n}:`}function R4({kind:e,max:t,min:r}){let n;return!r&&t===1?n="?":!r&&t===1/0?n="*":r===1&&t===1/0?n="+":r===t?n=`{${r}}`:n=`{${r},${t===1/0?"":t}}`,n+{greedy:"",lazy:"?",possessive:"+"}[e]}function no({type:e}){return e==="CapturingGroup"||e==="Group"||e==="LookaroundAssertion"}function D4(e){return e>47&&e<58}function ao({type:e,value:t}){return e==="Character"&&t===45}var Fr,gr,mn,Hr,pn,qa,I0,qr,O4=(qr=class extends RegExp{constructor(r,n,a){var t=(...OS)=>(super(...OS),Sr(this,qa),Sr(this,Fr,new Map),Sr(this,gr,null),Sr(this,mn),Sr(this,Hr,null),Sr(this,pn,null),Ae(this,"rawOptions",{}),this);const i=!!(a!=null&&a.lazyCompile);if(r instanceof RegExp){if(a)throw new Error("Cannot provide options when copying a regexp");const s=r;t(s,n),qt(this,mn,s.source),s instanceof qr&&(qt(this,Fr,ft(s,Fr)),qt(this,Hr,ft(s,Hr)),qt(this,pn,ft(s,pn)),this.rawOptions=s.rawOptions)}else{const s={hiddenCaptures:[],strategy:null,transfers:[],...a};t(i?"":r,n),qt(this,mn,r),qt(this,Fr,P4(s.hiddenCaptures,s.transfers)),qt(this,pn,s.strategy),this.rawOptions=a??{}}i||qt(this,gr,this)}get source(){return ft(this,mn)||"(?:)"}exec(r){if(!ft(this,gr)){const{lazyCompile:i,...s}=this.rawOptions;qt(this,gr,new qr(ft(this,mn),this.flags,s))}const n=this.global||this.sticky,a=this.lastIndex;if(ft(this,pn)==="clip_search"&&n&&a){this.lastIndex=0;const i=ii(this,qa,I0).call(this,r.slice(a));return i&&(M4(i,a,r,this.hasIndices),this.lastIndex+=a),i}return ii(this,qa,I0).call(this,r)}},Fr=new WeakMap,gr=new WeakMap,mn=new WeakMap,Hr=new WeakMap,pn=new WeakMap,qa=new WeakSet,I0=function(r){ft(this,gr).lastIndex=this.lastIndex;const n=Dl(qr.prototype,this,"exec").call(ft(this,gr),r);if(this.lastIndex=ft(this,gr).lastIndex,!n||!ft(this,Fr).size)return n;const a=[...n];n.length=1;let i;this.hasIndices&&(i=[...n.indices],n.indices.length=1);const s=[0];for(let u=1;u<a.length;u++){const{hidden:l,transferTo:o}=ft(this,Fr).get(u)??{};if(l?s.push(null):(s.push(n.length),n.push(a[u]),this.hasIndices&&n.indices.push(i[u])),o&&a[u]!==void 0){const c=s[o];if(!c)throw new Error(`Invalid capture transfer to "${c}"`);if(n[c]=a[u],this.hasIndices&&(n.indices[c]=i[u]),n.groups){ft(this,Hr)||qt(this,Hr,B4(this.source));const h=ft(this,Hr).get(o);h&&(n.groups[h]=a[u],this.hasIndices&&(n.indices.groups[h]=i[u]))}}}return n},qr);function M4(e,t,r,n){if(e.index+=t,e.input=r,n){const a=e.indices;for(let s=0;s<a.length;s++){const u=a[s];u&&(a[s]=[u[0]+t,u[1]+t])}const i=a.groups;i&&Object.keys(i).forEach(s=>{const u=i[s];u&&(i[s]=[u[0]+t,u[1]+t])})}}function P4(e,t){const r=new Map;for(const n of e)r.set(n,{hidden:!0});for(const[n,a]of t)for(const i of a)Pa(r,i,{}).transferTo=n;return r}function B4(e){const t=/(?<capture>\((?:\?<(?![=!])(?<name>[^>]+)>|(?!\?)))|\\?./gsu,r=new Map;let n=0,a=0,i;for(;i=t.exec(e);){const{0:s,groups:{capture:u,name:l}}=i;s==="["?n++:n?s==="]"&&n--:u&&(a++,l&&r.set(a,l))}return r}function F4(e,t){const r=H4(e,t);return r.options?new O4(r.pattern,r.flags,r.options):new RegExp(r.pattern,r.flags)}function H4(e,t){const r=Eh(t),n=hh(e,{flags:r.flags,normalizeUnknownPropertyNames:!0,rules:{captureGroup:r.rules.captureGroup,singleline:r.rules.singleline},skipBackrefValidation:r.rules.allowOrphanBackrefs,unicodePropertyMap:Au}),a=d4(n,{accuracy:r.accuracy,asciiWordBoundaries:r.rules.asciiWordBoundaries,avoidSubclass:r.avoidSubclass,bestEffortTarget:r.target}),i=k4(a,r),s=t4(i.pattern,{captureTransfers:i._captureTransfers,hiddenCaptures:i._hiddenCaptures,mode:"external"}),u=J2(s.pattern),l=Z2(u.pattern,{captureTransfers:s.captureTransfers,hiddenCaptures:s.hiddenCaptures}),o={pattern:l.pattern,flags:`${r.hasIndices?"d":""}${r.global?"g":""}${i.flags}${i.options.disable.v?"u":"v"}`};if(r.avoidSubclass){if(r.lazyCompileLength!==1/0)throw new Error("Lazy compilation requires subclass")}else{const c=l.hiddenCaptures.sort((b,E)=>b-E),h=Array.from(l.captureTransfers),f=a._strategy,p=o.pattern.length>=r.lazyCompileLength;(c.length||h.length||f||p)&&(o.options={...c.length&&{hiddenCaptures:c},...h.length&&{transfers:h},...f&&{strategy:f},...p&&{lazyCompile:p}})}return o}function z4(e,t){return F4(e,{global:!0,hasIndices:!0,lazyCompileLength:3e3,rules:{allowOrphanBackrefs:!0,asciiWordBoundaries:!0,captureGroup:!0,recursionLimit:5,singleline:!0},...t})}function $4(e={}){const t={target:"auto",cache:new Map,...e};return t.regexConstructor||(t.regexConstructor=r=>z4(r,{target:t.target})),{createScanner(r){return new e2(r,t)},createString:r2}}var U4=$4({forgiving:!0}),q4=Object.fromEntries(Xp.flatMap(e=>{var t;return((t=e.aliases)!=null?t:[]).map(r=>[r,e.id])})),Si=new Set(Object.keys(Yp)),io=e=>{let t=e.trim().toLowerCase();return q4[t]||(Si.has(t),t)},Bs=new Map,j4=3e5,G4=5e3,V4=64,Er=new Map,_0=0,Y4=(e,t)=>{let r=t.tokens.length+Math.ceil(e.length/V4);for(let n of t.tokens)r+=n.length;return r},so=e=>{let t=Er.get(e);return t&&(Er.delete(e),Er.set(e,t)),t==null?void 0:t.result},uo=e=>{let t=Er.get(e);t&&(Er.delete(e),_0-=t.cost)},W4=(e,t)=>{uo(e);let r=Y4(e,t);for(Er.set(e,{cost:r,result:t}),_0+=r;(_0>j4||Er.size>G4)&&Er.size>1;)uo(Er.keys().next().value)},N0=new Map,X4=4,Q4=(e,t)=>{let r=N0.get(e);if(!r)return;let n=r.findIndex(a=>t.startsWith(a.prefix));return n===-1?void 0:r.splice(n,1)[0]},lo=(e,t)=>{let r=N0.get(e);r||(r=[],N0.set(e,r)),r.unshift(t),r.length>X4&&r.pop()},oo=(e,t)=>{if(t!==0)for(let r of e)for(let n of r)n.offset+=t},K4=(e,t,r,n,a)=>{let i=Q4(r,t),s=i?i.prefix:"",u=i?i.rows:[],l=i==null?void 0:i.grammarState,o=t.lastIndexOf(`
|
|
143
143
|
`)+1;if(o>s.length){let h=e.codeToTokens(t.slice(s.length,o),{lang:n,themes:a,grammarState:l}),f=h.tokens;f.pop(),oo(f,s.length),u=u.concat(f),l=h.grammarState,s=t.slice(0,o),lo(r,{grammarState:l,prefix:s,rows:u})}else i&&lo(r,i);let c=e.codeToTokens(t.slice(o),{lang:n,themes:a,grammarState:l});return oo(c.tokens,o),{...c,tokens:u.concat(c.tokens)}},Pi=e=>{var t;return typeof e=="string"?e:(t=e.name)!=null?t:"custom"},_h=(e,t)=>`${e}-${Pi(t[0])}-${Pi(t[1])}`,Z4=(e,t,r)=>`${t}:${r[0]}:${r[1]}
|
|
144
144
|
${e}`,J4=(e,t)=>{let r=_h(e,t);if(Bs.has(r))return Bs.get(r);let n=Wp({themes:t,langs:[e],engine:U4});return Bs.set(r,n),n};function e3(e={}){var t;let r=(t=e.themes)!=null?t:["github-light","github-dark"];return{name:"shiki",type:"code-highlighter",supportsLanguage(n){let a=io(n);return Si.has(a)},getSupportedLanguages(){return Array.from(Si)},getThemes(){return r},highlight({code:n,language:a,themes:i,isIncomplete:s=!1},u){let l=io(a),o=[Pi(i[0]),Pi(i[1])],c=Si.has(l)?l:"text",h=Z4(n,c,o);return so(h)||(J4(c,i).then(p=>{let b=p.getLoadedLanguages().includes(l)?l:"text",E=so(h);E||(E=K4(p,n,`${_h(c,i)}:${b}`,b,{light:o[0],dark:o[1]}),s||W4(h,E)),u==null||u(E)}).catch(p=>{console.error("[Streamdown Code] Failed to highlight code:",p)}),null)}}}var t3=e3();const co=/[#.]/g;function r3(e,t){const r=e||"",n={};let a=0,i,s;for(;a<r.length;){co.lastIndex=a;const u=co.exec(r),l=r.slice(a,u?u.index:r.length);l&&(i?i==="#"?n.id=l:Array.isArray(n.className)?n.className.push(l):n.className=[l]:s=l,a+=l.length),u&&(i=u[0],a++)}return{type:"element",tagName:s||t||"div",properties:n,children:[]}}function Nh(e,t,r){const n=r?s3(r):void 0;function a(i,s,...u){let l;if(i==null){l={type:"root",children:[]};const o=s;u.unshift(o)}else{l=r3(i,t);const o=l.tagName.toLowerCase(),c=n?n.get(o):void 0;if(l.tagName=c||o,n3(s))u.unshift(s);else for(const[h,f]of Object.entries(s))a3(e,l.properties,h,f)}for(const o of u)L0(l.children,o);return l.type==="element"&&l.tagName==="template"&&(l.content={type:"root",children:l.children},l.children=[]),l}return a}function n3(e){if(e===null||typeof e!="object"||Array.isArray(e))return!0;if(typeof e.type!="string")return!1;const t=e,r=Object.keys(e);for(const n of r){const a=t[n];if(a&&typeof a=="object"){if(!Array.isArray(a))return!0;const i=a;for(const s of i)if(typeof s!="number"&&typeof s!="string")return!0}}return!!("children"in e&&Array.isArray(e.children))}function a3(e,t,r,n){const a=ts(e,r);let i;if(n!=null){if(typeof n=="number"){if(Number.isNaN(n))return;i=n}else typeof n=="boolean"?i=n:typeof n=="string"?a.spaceSeparated?i=Ol(n):a.commaSeparated?i=Ml(n):a.commaOrSpaceSeparated?i=Ol(Ml(n).join(" ")):i=ho(a,a.property,n):Array.isArray(n)?i=[...n]:i=a.property==="style"?i3(n):String(n);if(Array.isArray(i)){const s=[];for(const u of i)s.push(ho(a,a.property,u));i=s}a.property==="className"&&Array.isArray(t.className)&&(i=t.className.concat(i)),t[a.property]=i}}function L0(e,t){if(t!=null)if(typeof t=="number"||typeof t=="string")e.push({type:"text",value:String(t)});else if(Array.isArray(t))for(const r of t)L0(e,r);else if(typeof t=="object"&&"type"in t)t.type==="root"?L0(e,t.children):e.push(t);else throw new Error("Expected node, nodes, or string, got `"+t+"`")}function ho(e,t,r){if(typeof r=="string"){if(e.number&&r&&!Number.isNaN(Number(r)))return Number(r);if((e.boolean||e.overloadedBoolean)&&(r===""||Pl(r)===Pl(t)))return!0}return r}function i3(e){const t=[];for(const[r,n]of Object.entries(e))t.push([r,n].join(": "));return t.join("; ")}function s3(e){const t=new Map;for(const r of e)t.set(r.toLowerCase(),r);return t}const u3=["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","solidColor","textArea","textPath"],Lh=Nh(ja,"div"),Rh=Nh(Qr,"g",u3),er={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function l3(e,t){return Dh(e,{})||{type:"root",children:[]}}function Dh(e,t){const r=o3(e,t);return r&&t.afterTransform&&t.afterTransform(e,r),r}function o3(e,t){switch(e.nodeType){case 1:return f3(e,t);case 3:return h3(e);case 8:return d3(e);case 9:return fo(e,t);case 10:return c3();case 11:return fo(e,t);default:return}}function fo(e,t){return{type:"root",children:Oh(e,t)}}function c3(){return{type:"doctype"}}function h3(e){return{type:"text",value:e.nodeValue||""}}function d3(e){return{type:"comment",value:e.nodeValue||""}}function f3(e,t){const r=e.namespaceURI,n=r===er.svg?Rh:Lh,a=r===er.html?e.tagName.toLowerCase():e.tagName,i=r===er.html&&a==="template"?e.content:e,s=e.getAttributeNames(),u={};let l=-1;for(;++l<s.length;)u[s[l]]=e.getAttribute(s[l])||"";return n(a,u,Oh(i,t))}function Oh(e,t){const r=e.childNodes,n=[];let a=-1;for(;++a<r.length;){const i=Dh(r[a],t);i!==void 0&&n.push(i)}return n}new DOMParser;function m3(e,t){const r=p3(e);return l3(r)}function p3(e){const t=document.createElement("template");return t.innerHTML=e,t.content}const Va=(function(e){if(e==null)return E3;if(typeof e=="function")return ss(e);if(typeof e=="object")return Array.isArray(e)?g3(e):b3(e);if(typeof e=="string")return x3(e);throw new Error("Expected function, string, or object as test")});function g3(e){const t=[];let r=-1;for(;++r<e.length;)t[r]=Va(e[r]);return ss(n);function n(...a){let i=-1;for(;++i<t.length;)if(t[i].apply(this,a))return!0;return!1}}function b3(e){const t=e;return ss(r);function r(n){const a=n;let i;for(i in e)if(a[i]!==t[i])return!1;return!0}}function x3(e){return ss(t);function t(r){return r&&r.type===e}}function ss(e){return t;function t(r,n,a){return!!(y3(r)&&e.call(this,r,typeof n=="number"?n:void 0,a||void 0))}}function E3(){return!0}function y3(e){return e!==null&&typeof e=="object"&&"type"in e}const mo=(function(e,t,r){const n=Va(r);if(!e||!e.type||!e.children)throw new Error("Expected parent node");if(typeof t=="number"){if(t<0||t===Number.POSITIVE_INFINITY)throw new Error("Expected positive finite number as index")}else if(t=e.children.indexOf(t),t<0)throw new Error("Expected child node or index");for(;++t<e.children.length;)if(n(e.children[t],t,e))return e.children[t]}),vn=(function(e){if(e==null)return k3;if(typeof e=="string")return v3(e);if(typeof e=="object")return T3(e);if(typeof e=="function")return Su(e);throw new Error("Expected function, string, or array as `test`")});function T3(e){const t=[];let r=-1;for(;++r<e.length;)t[r]=vn(e[r]);return Su(n);function n(...a){let i=-1;for(;++i<t.length;)if(t[i].apply(this,a))return!0;return!1}}function v3(e){return Su(t);function t(r){return r.tagName===e}}function Su(e){return t;function t(r,n,a){return!!(w3(r)&&e.call(this,r,typeof n=="number"?n:void 0,a||void 0))}}function k3(e){return!!(e&&typeof e=="object"&&"type"in e&&e.type==="element"&&"tagName"in e&&typeof e.tagName=="string")}function w3(e){return e!==null&&typeof e=="object"&&"type"in e&&"tagName"in e}const po=/\n/g,go=/[\t ]+/g,R0=vn("br"),bo=vn(R3),A3=vn("p"),xo=vn("tr"),C3=vn(["datalist","head","noembed","noframes","noscript","rp","script","style","template","title",L3,D3]),Mh=vn(["address","article","aside","blockquote","body","caption","center","dd","dialog","dir","dl","dt","div","figure","figcaption","footer","form,","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","legend","li","listing","main","menu","nav","ol","p","plaintext","pre","section","ul","xmp"]);function S3(e,t){const r=t||{},n="children"in e?e.children:[],a=Mh(e),i=Fh(e,{whitespace:r.whitespace||"normal"}),s=[];(e.type==="text"||e.type==="comment")&&s.push(...Bh(e,{breakBefore:!0,breakAfter:!0}));let u=-1;for(;++u<n.length;)s.push(...Ph(n[u],e,{whitespace:i,breakBefore:u?void 0:a,breakAfter:u<n.length-1?R0(n[u+1]):a}));const l=[];let o;for(u=-1;++u<s.length;){const c=s[u];typeof c=="number"?o!==void 0&&c>o&&(o=c):c&&(o!==void 0&&o>-1&&l.push(`
|
|
145
145
|
`.repeat(o)||" "),o=-1,l.push(c))}return l.join("")}function Ph(e,t,r){return e.type==="element"?I3(e,t,r):e.type==="text"?r.whitespace==="normal"?Bh(e,r):_3(e):[]}function I3(e,t,r){const n=Fh(e,r),a=e.children||[];let i=-1,s=[];if(C3(e))return s;let u,l;for(R0(e)||xo(e)&&mo(t,e,xo)?l=`
|
|
@@ -523,8 +523,8 @@ ${t}</tr>
|
|
|
523
523
|
`}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${At(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:r,text:n,tokens:a,autolink:i}){let s=i?At(n,!0):this.parser.parseInline(a),u=x1(t);if(u===null)return s;t=At(u,i);let l='<a href="'+t+'"';return r&&(l+=' title="'+At(r)+'"'),l+=">"+s+"</a>",l}image({href:t,title:r,text:n,tokens:a}){a&&(n=this.parser.parseInline(a,this.parser.textRenderer));let i=x1(t);if(i===null)return At(n);t=i;let s=`<img src="${At(t)}" alt="${At(n)}"`;return r&&(s+=` title="${At(r)}"`),s+=">",s}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:At(t.text)}},Tl=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}checkbox({raw:e}){return e}},jt=class fu{constructor(t){Ae(this,"options");Ae(this,"renderer");Ae(this,"textRenderer");this.options=t||Cn,this.options.renderer=this.options.renderer||new Zi,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Tl}static parse(t,r){return new fu(r).parse(t)}static parseInline(t,r){return new fu(r).parseInline(t)}parse(t){var n,a;this.renderer.parser=this;let r="";for(let i=0;i<t.length;i++){let s=t[i];if((a=(n=this.options.extensions)==null?void 0:n.renderers)!=null&&a[s.type]){let l=s,o=this.options.extensions.renderers[l.type].call({parser:this},l);if(o!==!1||!["space","hr","heading","code","table","blockquote","list","checkbox","html","def","paragraph","text"].includes(l.type)){r+=o||"";continue}}let u=s;switch(u.type){case"space":{r+=this.renderer.space(u);break}case"hr":{r+=this.renderer.hr(u);break}case"heading":{r+=this.renderer.heading(u);break}case"code":{r+=this.renderer.code(u);break}case"table":{r+=this.renderer.table(u);break}case"blockquote":{r+=this.renderer.blockquote(u);break}case"list":{r+=this.renderer.list(u);break}case"checkbox":{r+=this.renderer.checkbox(u);break}case"html":{r+=this.renderer.html(u);break}case"def":{r+=this.renderer.def(u);break}case"paragraph":{r+=this.renderer.paragraph(u);break}case"text":{r+=this.renderer.text(u);break}default:{let l='Token with "'+u.type+'" type was not found.';if(this.options.silent)return console.error(l),"";throw new Error(l)}}}return r}parseInline(t,r=this.renderer){var a,i;this.renderer.parser=this;let n="";for(let s=0;s<t.length;s++){let u=t[s];if((i=(a=this.options.extensions)==null?void 0:a.renderers)!=null&&i[u.type]){let o=this.options.extensions.renderers[u.type].call({parser:this},u);if(o!==!1||!["escape","html","link","image","checkbox","strong","em","codespan","br","del","text"].includes(u.type)){n+=o||"";continue}}let l=u;switch(l.type){case"escape":{n+=r.text(l);break}case"html":{n+=r.html(l);break}case"link":{n+=r.link(l);break}case"image":{n+=r.image(l);break}case"checkbox":{n+=r.checkbox(l);break}case"strong":{n+=r.strong(l);break}case"em":{n+=r.em(l);break}case"codespan":{n+=r.codespan(l);break}case"br":{n+=r.br(l);break}case"del":{n+=r.del(l);break}case"text":{n+=r.text(l);break}default:{let o='Token with "'+l.type+'" type was not found.';if(this.options.silent)return console.error(o),"";throw new Error(o)}}}return n}},Ai,ka=(Ai=class{constructor(e){Ae(this,"options");Ae(this,"block");this.options=e||Cn}preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(e=this.block){return e?Ot.lex:Ot.lexInline}provideParser(e=this.block){return e?jt.parse:jt.parseInline}},Ae(Ai,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),Ae(Ai,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),Ai),jw=class{constructor(...t){Ae(this,"defaults",ml());Ae(this,"options",this.setOptions);Ae(this,"parse",this.parseMarkdown(!0));Ae(this,"parseInline",this.parseMarkdown(!1));Ae(this,"Parser",jt);Ae(this,"Renderer",Zi);Ae(this,"TextRenderer",Tl);Ae(this,"Lexer",Ot);Ae(this,"Tokenizer",Ki);Ae(this,"Hooks",ka);this.use(...t)}walkTokens(t,r){var a,i;let n=[];for(let s of t)switch(n=n.concat(r.call(this,s)),s.type){case"table":{let u=s;for(let l of u.header)n=n.concat(this.walkTokens(l.tokens,r));for(let l of u.rows)for(let o of l)n=n.concat(this.walkTokens(o.tokens,r));break}case"list":{let u=s;n=n.concat(this.walkTokens(u.items,r));break}default:{let u=s;(i=(a=this.defaults.extensions)==null?void 0:a.childTokens)!=null&&i[u.type]?this.defaults.extensions.childTokens[u.type].forEach(l=>{let o=u[l].flat(1/0);n=n.concat(this.walkTokens(o,r))}):u.tokens&&(n=n.concat(this.walkTokens(u.tokens,r)))}}return n}use(...t){let r=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(n=>{let a={...n};if(a.async=this.defaults.async||a.async||!1,n.extensions&&(n.extensions.forEach(i=>{if(!i.name)throw new Error("extension name required");if("renderer"in i){let s=r.renderers[i.name];s?r.renderers[i.name]=function(...u){let l=i.renderer.apply(this,u);return l===!1&&(l=s.apply(this,u)),l}:r.renderers[i.name]=i.renderer}if("tokenizer"in i){if(!i.level||i.level!=="block"&&i.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let s=r[i.level];s?s.unshift(i.tokenizer):r[i.level]=[i.tokenizer],i.start&&(i.level==="block"?r.startBlock?r.startBlock.push(i.start):r.startBlock=[i.start]:i.level==="inline"&&(r.startInline?r.startInline.push(i.start):r.startInline=[i.start]))}"childTokens"in i&&i.childTokens&&(r.childTokens[i.name]=i.childTokens)}),a.extensions=r),n.renderer){let i=this.defaults.renderer||new Zi(this.defaults);for(let s in n.renderer){if(!(s in i))throw new Error(`renderer '${s}' does not exist`);if(["options","parser"].includes(s))continue;let u=s,l=n.renderer[u],o=i[u];i[u]=(...c)=>{let h=l.apply(i,c);return h===!1&&(h=o.apply(i,c)),h||""}}a.renderer=i}if(n.tokenizer){let i=this.defaults.tokenizer||new Ki(this.defaults);for(let s in n.tokenizer){if(!(s in i))throw new Error(`tokenizer '${s}' does not exist`);if(["options","rules","lexer"].includes(s))continue;let u=s,l=n.tokenizer[u],o=i[u];i[u]=(...c)=>{let h=l.apply(i,c);return h===!1&&(h=o.apply(i,c)),h}}a.tokenizer=i}if(n.hooks){let i=this.defaults.hooks||new ka;for(let s in n.hooks){if(!(s in i))throw new Error(`hook '${s}' does not exist`);if(["options","block"].includes(s))continue;let u=s,l=n.hooks[u],o=i[u];ka.passThroughHooks.has(s)?i[u]=c=>{if(this.defaults.async&&ka.passThroughHooksRespectAsync.has(s))return(async()=>{let f=await l.call(i,c);return o.call(i,f)})();let h=l.call(i,c);return o.call(i,h)}:i[u]=(...c)=>{if(this.defaults.async)return(async()=>{let f=await l.apply(i,c);return f===!1&&(f=await o.apply(i,c)),f})();let h=l.apply(i,c);return h===!1&&(h=o.apply(i,c)),h}}a.hooks=i}if(n.walkTokens){let i=this.defaults.walkTokens,s=n.walkTokens;a.walkTokens=function(u){let l=[];return l.push(s.call(this,u)),i&&(l=l.concat(i.call(this,u))),l}}this.defaults={...this.defaults,...a}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,r){return Ot.lex(t,r??this.defaults)}parser(t,r){return jt.parse(t,r??this.defaults)}parseMarkdown(t){return(r,n)=>{let a={...n},i={...this.defaults,...a},s=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&a.async===!1)return s(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof r>"u"||r===null)return s(new Error("marked(): input parameter is undefined or null"));if(typeof r!="string")return s(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(r)+", string expected"));if(i.hooks&&(i.hooks.options=i,i.hooks.block=t),i.async)return(async()=>{let u=i.hooks?await i.hooks.preprocess(r):r,l=await(i.hooks?await i.hooks.provideLexer(t):t?Ot.lex:Ot.lexInline)(u,i),o=i.hooks?await i.hooks.processAllTokens(l):l;i.walkTokens&&await Promise.all(this.walkTokens(o,i.walkTokens));let c=await(i.hooks?await i.hooks.provideParser(t):t?jt.parse:jt.parseInline)(o,i);return i.hooks?await i.hooks.postprocess(c):c})().catch(s);try{i.hooks&&(r=i.hooks.preprocess(r));let u=(i.hooks?i.hooks.provideLexer(t):t?Ot.lex:Ot.lexInline)(r,i);i.hooks&&(u=i.hooks.processAllTokens(u)),i.walkTokens&&this.walkTokens(u,i.walkTokens);let l=(i.hooks?i.hooks.provideParser(t):t?jt.parse:jt.parseInline)(u,i);return i.hooks&&(l=i.hooks.postprocess(l)),l}catch(u){return s(u)}}}onError(t,r){return n=>{if(n.message+=`
|
|
524
524
|
Please report this to https://github.com/markedjs/marked.`,t){let a="<p>An error occurred:</p><pre>"+At(n.message+"",!0)+"</pre>";return r?Promise.resolve(a):a}if(r)return Promise.reject(n);throw n}}},Tn=new jw;function Ne(e,t){return Tn.parse(e,t)}Ne.options=Ne.setOptions=function(e){return Tn.setOptions(e),Ne.defaults=Tn.defaults,Sm(Ne.defaults),Ne};Ne.getDefaults=ml;Ne.defaults=Cn;function Gw(...e){return Tn.use(...e),Ne.defaults=Tn.defaults,Sm(Ne.defaults),Ne}Ne.use=Gw;Ne.walkTokens=function(e,t){return Tn.walkTokens(e,t)};Ne.parseInline=Tn.parseInline;Ne.Parser=jt;Ne.parser=jt.parse;Ne.Renderer=Zi;Ne.TextRenderer=Tl;Ne.Lexer=Ot;Ne.lexer=Ot.lex;Ne.Tokenizer=Ki;Ne.Hooks=ka;Ne.parse=Ne;Ne.options;Ne.setOptions;Ne.walkTokens;Ne.parseInline;jt.parse;Ot.lex;var Vw=300,Yw="300px",Ww=500;function Xw(e={}){let{immediate:t=!1,debounceDelay:r=Vw,rootMargin:n=Yw,idleTimeout:a=Ww}=e,[i,s]=D.useState(!1),u=D.useRef(null),l=D.useRef(null),o=D.useRef(null),c=D.useMemo(()=>p=>{let b=Date.now();return window.setTimeout(()=>{p({didTimeout:!1,timeRemaining:()=>Math.max(0,50-(Date.now()-b))})},1)},[]),h=D.useMemo(()=>typeof window<"u"&&window.requestIdleCallback?(p,b)=>window.requestIdleCallback(p,b):c,[c]),f=D.useMemo(()=>typeof window<"u"&&window.cancelIdleCallback?p=>window.cancelIdleCallback(p):p=>{clearTimeout(p)},[]);return D.useEffect(()=>{if(t){s(!0);return}let p=u.current;if(!p)return;l.current&&(clearTimeout(l.current),l.current=null),o.current&&(f(o.current),o.current=null);let b=()=>{l.current&&(clearTimeout(l.current),l.current=null),o.current&&(f(o.current),o.current=null)},E=w=>{o.current=h(H=>{H.timeRemaining()>0||H.didTimeout?(s(!0),w.disconnect()):o.current=h(()=>{s(!0),w.disconnect()},{timeout:a/2})},{timeout:a})},T=w=>{b(),l.current=window.setTimeout(()=>{var H,z;let O=w.takeRecords();(O.length===0||(z=(H=O.at(-1))==null?void 0:H.isIntersecting)!=null&&z)&&E(w)},r)},k=(w,H)=>{w.isIntersecting?T(H):b()},C=new IntersectionObserver(w=>{for(let H of w)k(H,C)},{rootMargin:n,threshold:0});return C.observe(p),()=>{l.current&&clearTimeout(l.current),o.current&&f(o.current),C.disconnect()}},[t,r,n,a,f,h]),{shouldRender:i,containerRef:u}}var Qw=320,Kw=4,Bm=()=>typeof performance>"u"?Date.now():performance.now();function A1(e){var t,r;let n=(t=e==null?void 0:e.now)!=null?t:Bm,a=(r=e==null?void 0:e.maxBacklogMs)!=null?r:Qw,i=0,s=0;return{now:n,beginPass(u){s=Math.min(Math.max(i,u),u+a)},mark(){return s},rewind(u){s=u},take(u,l,o){if(u<=0)return{baseDelay:0,step:Math.max(0,l)};let c=Math.max(0,l),h=c===0?0:Math.min(c,Kw),f=Math.max(s,o),p=o+a,b=f+Math.max(0,u-1)*c,E=c;if(b>p&&u>1)if(f<p){let k=p-f;E=Math.max(h,k/(u-1))}else E=h;let T=Math.max(0,Math.round(f-o));return s=f+u*E,{baseDelay:T,step:E}},commitPass(){i=s}}}var Fm=/\s/,vl=/^\s+$/,Zw=new Set(["pre","svg","math","annotation"]),Jw=new Set(["img","hr"]),ai=e=>typeof e=="object"&&e!==null&&"type"in e&&e.type==="element",kl=e=>e.some(t=>ai(t)&&Zw.has(t.tagName)),eA=e=>{for(let t=e.length-1;t>=0;t--){let r=e[t];if(ai(r)&&r.tagName==="li")return r}},tA=(e,t,r,n)=>{e.properties!=null||(e.properties={}),e.properties["data-sd-animate-marker"]=!0;let a=typeof e.properties.style=="string"?`${e.properties.style};`:"";e.properties.style=`${a}--sd-marker-duration:${t}ms;--sd-marker-delay:${Math.round(r)}ms;--sd-marker-easing:${n}`},rA=new Set(["ul","ol","li"]),Hm=e=>{for(let t of e.children)if(ai(t)){if(t.tagName==="input")return t;if(rA.has(t.tagName))continue;let r=Hm(t);if(r)return r}},zm=(e,t,r,n)=>{e.properties!=null||(e.properties={}),e.properties["data-sd-animate"]=!0;let a=typeof e.properties.style=="string"?`${e.properties.style};`:"";e.properties.style=`${a}--sd-animation:sd-${t.animation};--sd-duration:${r}ms;--sd-easing:${t.easing};--sd-delay:${Math.round(n)}ms`},nA=(e,t,r,n)=>{let a=Hm(e);a&&zm(a,t,r,n)},aA=(e,t,r,n,a,i)=>{if(kl(t))return;let s=n.prevContentLength,u=a.count;a.count+=1;let l=s>0&&u<s,o=l?0:i.baseDelay+a.newIndex++*i.step;zm(e,r,l?0:r.duration,o)},iA=e=>{var t;for(let r=e.length-1;r>=0;r-=1){let n=e[r];if(ai(n)){if((t=n.properties)!=null&&t["data-sd-animated"])break;n.properties={...n.properties,"data-sd-animated":!0}}}},$m=e=>{let t=[],r="",n=!1;for(let a of e){let i=Fm.test(a);if(i!==n&&r){if(i){r+=a,n=!0;continue}t.push(r),r=""}r+=a,n=i}return r&&t.push(r),t},Um=e=>{let t=[],r="";for(let n of e)Fm.test(n)?t.length>0&&!vl.test(t.at(-1))?t[t.length-1]+=n:r+=n:(r&&(t.push(r),r=""),t.push(n));return r&&(t.length>0?t[t.length-1]+=r:t.push(r)),t},C1=/^[^\s;:'"\\/](?:[^;:'"\\/\r\n]*[^\s;:'"\\/])?$/,sA=(e,t,r,n)=>{let a=`sd-${t.animation}`,i=`${r?0:t.duration}ms`,s;return t.styleObjects?(s={"--sd-animation":a,"--sd-duration":i,"--sd-easing":t.easing},n&&(s["--sd-delay"]=`${Math.round(n)}ms`)):(s=`--sd-animation:${a};--sd-duration:${i};--sd-easing:${t.easing}`,n&&(s+=`;--sd-delay:${Math.round(n)}ms`)),{type:"element",tagName:"span",properties:{"data-sd-animate":!0,style:s},children:[{type:"text",value:e}]}},S1=(e,t)=>!(e>0&&t<e),mu=e=>ai(e)&&Jw.has(e.tagName),uA=(e,t,r)=>{let n=0,a=0;return Xa(e,i=>i.type==="text"||mu(i),(i,s)=>{if(kl(s))return $r;if(mu(i)){S1(r,a)&&(n+=1),a+=1;return}let u=i.value;if(!u.trim()){a+=u.length;return}let l=t.sep==="char"?Um(u):$m(u);for(let o of l){let c=a;a+=o.length,!vl.test(o)&&S1(r,c)&&(n+=1)}}),n},lA=(e,t,r,n,a,i)=>{var s;let u=t.at(-1);if(!(u&&"children"in u))return;if(kl(t))return $r;let l=u,o=l.children.indexOf(e);if(o===-1)return;let c=e.value;if(!c.trim()){a.count+=c.length;return}let h=r.sep==="char"?Um(c):$m(c),f=n.prevContentLength,p=!1,b=eA(t),E=!!(b&&!((s=b.properties)!=null&&s["data-sd-animate-marker"])),T=!1,k=h.map(C=>{let w=a.count;if(a.count+=C.length,vl.test(C))return{type:"text",value:C};let H=f>0&&w<f,z=H?0:i.baseDelay+a.newIndex++*i.step;if(p=!0,b&&E&&!T){let O=H?0:r.duration;tA(b,O,z,r.easing),nA(b,r,O,z),T=!0}return sA(C,r,H,z)});return p&&iA(t),l.children.splice(o,1,...k),o+k.length},oA=0;function cA(e){return qm(e,!1)}var hA=e=>qm(e,!0);function qm(e,t){var r,n,a,i,s;let u=(r=e==null?void 0:e.animation)!=null?r:"fadeIn",l=(n=e==null?void 0:e.easing)!=null?n:"ease",o={animation:u,duration:(a=e==null?void 0:e.duration)!=null?a:150,easing:l,sep:(i=e==null?void 0:e.sep)!=null?i:"word",stagger:(s=e==null?void 0:e.stagger)!=null?s:40,styleObjects:t&&C1.test(u)&&C1.test(l),timeline:e==null?void 0:e.timeline},c={committedCharCount:0,prevContentLength:0,lastRenderCharCount:0,pendingMark:null},h=oA++,f=()=>p=>{var b;let E={count:0,newIndex:0};c.prevContentLength=c.committedCharCount;let T=o.timeline,k=(b=T==null?void 0:T.now())!=null?b:Bm();T&&(c.pendingMark===null?c.pendingMark=T.mark():T.rewind(c.pendingMark));let C=T?T.take(uA(p,o,c.prevContentLength),o.stagger,k):{baseDelay:0,step:o.stagger};Xa(p,w=>w.type==="text"||mu(w),(w,H)=>{if(w.type==="text")return lA(w,H,o,c,E,C);aA(w,H,o,c,E,C)}),c.lastRenderCharCount=E.count,c.prevContentLength=0};return Object.defineProperty(f,"name",{value:`rehypeAnimate$${h}`}),{name:"animate",type:"animate",rehypePlugin:f,setPrevContentLength(p){c.committedCharCount=p,c.prevContentLength=p},getLastRenderCharCount(){return c.lastRenderCharCount},commit(){c.committedCharCount=c.lastRenderCharCount,c.pendingMark=null}}}cA();var jm=D.createContext(!1),Gm=()=>D.useContext(jm),Is=(...e)=>ah(nh(e)),dA=(e,t)=>{if(!e||!t)return t;let r=`${e}:`;return t.split(/\s+/).filter(Boolean).map(n=>n.startsWith(r)?n:`${e}:${n}`).join(" ")},fA=e=>e?(...t)=>dA(e,ah(nh(t))):Is,Un=(e,t,r)=>{let n=typeof t=="string"&&r.startsWith("text/csv")?"\uFEFF":"",a=typeof t=="string"?new Blob([n+t],{type:r}):t,i=URL.createObjectURL(a),s=document.createElement("a");s.href=i,s.download=e,document.body.appendChild(s),s.click(),document.body.removeChild(s),URL.revokeObjectURL(i)},pu=D.createContext(Is),ve=()=>D.useContext(pu),mA=8,Vm=e=>{if(!(e===void 0||e===0||e===Number.POSITIVE_INFINITY)){if(typeof e=="number")return Number.isFinite(e)&&e>0?`${e}px`:void 0;if(!(e==="0"||e==="none"||e==="Infinity"))return e}},Ym=(e,t,r)=>{let n=D.useRef(null),a=D.useRef(!0),i=D.useRef(!1),s=D.useRef(null);return D.useEffect(()=>{let u=n.current;if(!(u&&t))return;let l=()=>{let o=u.scrollHeight-u.scrollTop-u.clientHeight<mA;a.current=o};return u.addEventListener("scroll",l,{passive:!0}),()=>u.removeEventListener("scroll",l)},[t]),D.useEffect(()=>{e&&!i.current&&(a.current=!0),e||(a.current=!0),i.current=e},[e]),D.useEffect(()=>()=>{s.current!==null&&cancelAnimationFrame(s.current)},[]),D.useEffect(()=>{let u=n.current;!(u&&t&&e&&a.current)||s.current!==null||(s.current=requestAnimationFrame(()=>{s.current=null,a.current&&u.scrollTo({top:u.scrollHeight,behavior:"instant"})}))},[e,t,r]),n},pA=Is("block"),gA=Is("block","before:content-[counter(line)]","before:inline-block","before:[counter-increment:line]","before:w-6","before:mr-4","before:text-[13px]","before:text-right","before:text-muted-foreground/50","before:font-mono","before:select-none"),bA=e=>{let t={};for(let r of e.split(";")){let n=r.indexOf(":");if(n>0){let a=r.slice(0,n).trim(),i=r.slice(n+1).trim();a&&i&&(t[a]=i)}}return t},xA=D.memo(({children:e,result:t,language:r,className:n,maxHeight:a,startLine:i,lineNumbers:s=!0,...u})=>{let l=ve(),{isAnimating:o}=D.useContext(ut),c=Vm(a),h=Ym(o,!!c,t),f=D.useMemo(()=>l(gA),[l]),p=D.useMemo(()=>l(pA),[l]),b=D.useMemo(()=>{let E={};return t.bg&&(E["--sdm-bg"]=t.bg),t.fg&&(E["--sdm-fg"]=t.fg),t.rootStyle&&Object.assign(E,bA(t.rootStyle)),E},[t.bg,t.fg,t.rootStyle]);return I.jsx("div",{className:l(n,c?"overflow-y-auto":null,"overflow-x-auto rounded-md border border-border bg-background p-4 text-sm"),"data-language":r,"data-streamdown":"code-block-body",ref:h,style:c?{maxHeight:c}:void 0,...u,children:I.jsx("pre",{className:l(n,"bg-[var(--sdm-bg,inherit)]","dark:bg-[var(--shiki-dark-bg,var(--sdm-bg,inherit))]"),style:b,children:I.jsx("code",{className:s?l("[counter-increment:line_0] [counter-reset:line]"):void 0,style:s&&i&&i>1?{counterReset:`line ${i-1}`}:void 0,children:t.tokens.map((E,T)=>I.jsx("span",{className:s?f:p,children:E.length===0||E.length===1&&E[0].content===""?`
|
|
525
525
|
`:E.map((k,C)=>{let w={},H=!!k.bgColor;if(k.color&&(w["--sdm-c"]=k.color),k.bgColor&&(w["--sdm-tbg"]=k.bgColor),k.htmlStyle)for(let[z,O]of Object.entries(k.htmlStyle))z==="color"?w["--sdm-c"]=O:z==="background-color"?(w["--sdm-tbg"]=O,H=!0):w[z]=O;return I.jsx("span",{className:l("text-[var(--sdm-c,inherit)]","dark:text-[var(--shiki-dark,var(--sdm-c,inherit))]",H&&"bg-[var(--sdm-tbg)]",H&&"dark:bg-[var(--shiki-dark-bg,var(--sdm-tbg))]"),style:w,...k.htmlAttrs,children:k.content},C)})},T))})})})}),EA=({className:e,language:t,style:r,isIncomplete:n,...a})=>{let i=ve();return I.jsx("div",{className:i("relative my-4 flex w-full flex-col gap-2 rounded-xl border border-border bg-sidebar p-2",e),"data-incomplete":n||void 0,"data-language":t,"data-streamdown":"code-block",style:{contentVisibility:"auto",containIntrinsicSize:"auto 200px",...r},...a})},Wm=D.createContext({code:""}),Xm=()=>D.useContext(Wm),yA=({language:e})=>{let t=ve();return I.jsx("div",{className:t("flex h-8 items-center text-muted-foreground text-xs"),"data-language":e,"data-streamdown":"code-block-header",children:I.jsx("span",{className:t("ml-1 font-mono lowercase"),children:e})})},TA=e=>{let t=e.length;for(;t>0&&e[t-1]===`
|
|
526
|
-
`;)t--;return e.slice(0,t)},vA=D.lazy(()=>J1(()=>import("./highlighted-body-KQOG7T2V-
|
|
527
|
-
`).map(f=>[{content:f,color:"inherit",bgColor:"transparent",htmlStyle:{},offset:0}])}),[c]);return I.jsx(Wm.Provider,{value:{code:e},children:I.jsxs(EA,{dir:"ltr",isIncomplete:a,language:t,children:[I.jsx(yA,{language:t}),n?I.jsx("div",{className:l("pointer-events-none absolute top-2 right-2 z-10 flex items-center"),children:I.jsx("div",{className:l("pointer-events-auto flex shrink-0 items-center gap-2 rounded-md border border-sidebar bg-sidebar/80 px-1.5 py-1 supports-[backdrop-filter]:bg-sidebar/70 supports-[backdrop-filter]:backdrop-blur"),"data-streamdown":"code-block-actions",children:n})}):null,I.jsx(D.Suspense,{fallback:I.jsx(xA,{className:r,language:t,lineNumbers:s,maxHeight:o,result:h,startLine:i,...u}),children:I.jsx(vA,{className:r,code:c,isIncomplete:a,language:t,lineNumbers:s,maxHeight:o,raw:h,startLine:i,...u})})]})})},wA=e=>I.jsx("svg",{"aria-hidden":"true",color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:I.jsx("path",{clipRule:"evenodd",d:"M15.5607 3.99999L15.0303 4.53032L6.23744 13.3232C5.55403 14.0066 4.44599 14.0066 3.76257 13.3232L4.2929 12.7929L3.76257 13.3232L0.969676 10.5303L0.439346 9.99999L1.50001 8.93933L2.03034 9.46966L4.82323 12.2626C4.92086 12.3602 5.07915 12.3602 5.17678 12.2626L13.9697 3.46966L14.5 2.93933L15.5607 3.99999Z",fill:"currentColor",fillRule:"evenodd"})}),AA=e=>I.jsx("svg",{"aria-hidden":"true",color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:I.jsx("path",{clipRule:"evenodd",d:"M2.75 0.5C1.7835 0.5 1 1.2835 1 2.25V9.75C1 10.7165 1.7835 11.5 2.75 11.5H3.75H4.5V10H3.75H2.75C2.61193 10 2.5 9.88807 2.5 9.75V2.25C2.5 2.11193 2.61193 2 2.75 2H8.25C8.38807 2 8.5 2.11193 8.5 2.25V3H10V2.25C10 1.2835 9.2165 0.5 8.25 0.5H2.75ZM7.75 4.5C6.7835 4.5 6 5.2835 6 6.25V13.75C6 14.7165 6.7835 15.5 7.75 15.5H13.25C14.2165 15.5 15 14.7165 15 13.75V6.25C15 5.2835 14.2165 4.5 13.25 4.5H7.75ZM7.5 6.25C7.5 6.11193 7.61193 6 7.75 6H13.25C13.3881 6 13.5 6.11193 13.5 6.25V13.75C13.5 13.8881 13.3881 14 13.25 14H7.75C7.61193 14 7.5 13.8881 7.5 13.75V6.25Z",fill:"currentColor",fillRule:"evenodd"})}),CA=e=>I.jsx("svg",{"aria-hidden":"true",color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:I.jsx("path",{clipRule:"evenodd",d:"M8.75 1V1.75V8.68934L10.7197 6.71967L11.25 6.18934L12.3107 7.25L11.7803 7.78033L8.70711 10.8536C8.31658 11.2441 7.68342 11.2441 7.29289 10.8536L4.21967 7.78033L3.68934 7.25L4.75 6.18934L5.28033 6.71967L7.25 8.68934V1.75V1H8.75ZM13.5 9.25V13.5H2.5V9.25V8.5H1V9.25V14C1 14.5523 1.44771 15 2 15H14C14.5523 15 15 14.5523 15 14V9.25V8.5H13.5V9.25Z",fill:"currentColor",fillRule:"evenodd"})}),SA=e=>I.jsxs("svg",{"aria-hidden":"true",color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:[I.jsx("path",{d:"M8 0V4",stroke:"currentColor",strokeWidth:"1.5"}),I.jsx("path",{d:"M8 16V12",opacity:"0.5",stroke:"currentColor",strokeWidth:"1.5"}),I.jsx("path",{d:"M3.29773 1.52783L5.64887 4.7639",opacity:"0.9",stroke:"currentColor",strokeWidth:"1.5"}),I.jsx("path",{d:"M12.7023 1.52783L10.3511 4.7639",opacity:"0.1",stroke:"currentColor",strokeWidth:"1.5"}),I.jsx("path",{d:"M12.7023 14.472L10.3511 11.236",opacity:"0.4",stroke:"currentColor",strokeWidth:"1.5"}),I.jsx("path",{d:"M3.29773 14.472L5.64887 11.236",opacity:"0.6",stroke:"currentColor",strokeWidth:"1.5"}),I.jsx("path",{d:"M15.6085 5.52783L11.8043 6.7639",opacity:"0.2",stroke:"currentColor",strokeWidth:"1.5"}),I.jsx("path",{d:"M0.391602 10.472L4.19583 9.23598",opacity:"0.7",stroke:"currentColor",strokeWidth:"1.5"}),I.jsx("path",{d:"M15.6085 10.4722L11.8043 9.2361",opacity:"0.3",stroke:"currentColor",strokeWidth:"1.5"}),I.jsx("path",{d:"M0.391602 5.52783L4.19583 6.7639",opacity:"0.8",stroke:"currentColor",strokeWidth:"1.5"})]}),IA=e=>I.jsx("svg",{"aria-hidden":"true",color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:I.jsx("path",{clipRule:"evenodd",d:"M1 5.25V6H2.5V5.25V2.5H5.25H6V1H5.25H2C1.44772 1 1 1.44772 1 2V5.25ZM5.25 14.9994H6V13.4994H5.25H2.5V10.7494V9.99939H1V10.7494V13.9994C1 14.5517 1.44772 14.9994 2 14.9994H5.25ZM15 10V10.75V14C15 14.5523 14.5523 15 14 15H10.75H10V13.5H10.75H13.5V10.75V10H15ZM10.75 1H10V2.5H10.75H13.5V5.25V6H15V5.25V2C15 1.44772 14.5523 1 14 1H10.75Z",fill:"currentColor",fillRule:"evenodd"})}),_A=e=>I.jsx("svg",{"aria-hidden":"true",color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:I.jsx("path",{clipRule:"evenodd",d:"M13.5 8C13.5 4.96643 11.0257 2.5 7.96452 2.5C5.42843 2.5 3.29365 4.19393 2.63724 6.5H5.25H6V8H5.25H0.75C0.335787 8 0 7.66421 0 7.25V2.75V2H1.5V2.75V5.23347C2.57851 2.74164 5.06835 1 7.96452 1C11.8461 1 15 4.13001 15 8C15 11.87 11.8461 15 7.96452 15C5.62368 15 3.54872 13.8617 2.27046 12.1122L1.828 11.5066L3.03915 10.6217L3.48161 11.2273C4.48831 12.6051 6.12055 13.5 7.96452 13.5C11.0257 13.5 13.5 11.0336 13.5 8Z",fill:"currentColor",fillRule:"evenodd"})}),NA=e=>I.jsx("svg",{"aria-hidden":"true",color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:I.jsx("path",{clipRule:"evenodd",d:"M12.4697 13.5303L13 14.0607L14.0607 13L13.5303 12.4697L9.06065 7.99999L13.5303 3.53032L14.0607 2.99999L13 1.93933L12.4697 2.46966L7.99999 6.93933L3.53032 2.46966L2.99999 1.93933L1.93933 2.99999L2.46966 3.53032L6.93933 7.99999L2.46966 12.4697L1.93933 13L2.99999 14.0607L3.53032 13.5303L7.99999 9.06065L12.4697 13.5303Z",fill:"currentColor",fillRule:"evenodd"})}),LA=e=>I.jsx("svg",{"aria-hidden":"true",color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:I.jsx("path",{clipRule:"evenodd",d:"M13.5 10.25V13.25C13.5 13.3881 13.3881 13.5 13.25 13.5H2.75C2.61193 13.5 2.5 13.3881 2.5 13.25L2.5 2.75C2.5 2.61193 2.61193 2.5 2.75 2.5H5.75H6.5V1H5.75H2.75C1.7835 1 1 1.7835 1 2.75V13.25C1 14.2165 1.7835 15 2.75 15H13.25C14.2165 15 15 14.2165 15 13.25V10.25V9.5H13.5V10.25ZM9 1H9.75H14.2495C14.6637 1 14.9995 1.33579 14.9995 1.75V6.25V7H13.4995V6.25V3.56066L8.53033 8.52978L8 9.06011L6.93934 7.99945L7.46967 7.46912L12.4388 2.5H9.75H9V1Z",fill:"currentColor",fillRule:"evenodd"})}),RA=e=>I.jsx("svg",{"aria-hidden":"true",color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:I.jsx("path",{clipRule:"evenodd",d:"M1.5 6.5C1.5 3.73858 3.73858 1.5 6.5 1.5C9.26142 1.5 11.5 3.73858 11.5 6.5C11.5 9.26142 9.26142 11.5 6.5 11.5C3.73858 11.5 1.5 9.26142 1.5 6.5ZM6.5 0C2.91015 0 0 2.91015 0 6.5C0 10.0899 2.91015 13 6.5 13C8.02469 13 9.42677 12.475 10.5353 11.596L13.9697 15.0303L14.5 15.5607L15.5607 14.5L15.0303 13.9697L11.596 10.5353C12.475 9.42677 13 8.02469 13 6.5C13 2.91015 10.0899 0 6.5 0ZM4.125 5.875H4.75H5.875V4.75V4.125H7.125V4.75V5.875H8.25H8.875V7.125H8.25H7.125V8.25V8.875H5.875V8.25V7.125H4.75H4.125V5.875Z",fill:"currentColor",fillRule:"evenodd"})}),DA=e=>I.jsx("svg",{"aria-hidden":"true",color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:I.jsx("path",{clipRule:"evenodd",d:"M1.5 6.5C1.5 3.73858 3.73858 1.5 6.5 1.5C9.26142 1.5 11.5 3.73858 11.5 6.5C11.5 9.26142 9.26142 11.5 6.5 11.5C3.73858 11.5 1.5 9.26142 1.5 6.5ZM6.5 0C2.91015 0 0 2.91015 0 6.5C0 10.0899 2.91015 13 6.5 13C8.02469 13 9.42677 12.475 10.5353 11.596L13.9697 15.0303L14.5 15.5607L15.5607 14.5L15.0303 13.9697L11.596 10.5353C12.475 9.42677 13 8.02469 13 6.5C13 2.91015 10.0899 0 6.5 0ZM4.125 5.875H4.75H8.25H8.875V7.125H8.25H4.75H4.125V5.875Z",fill:"currentColor",fillRule:"evenodd"})}),wa={CheckIcon:wA,CopyIcon:AA,DownloadIcon:CA,ExternalLinkIcon:LA,Loader2Icon:SA,Maximize2Icon:IA,RotateCcwIcon:_A,XIcon:NA,ZoomInIcon:RA,ZoomOutIcon:DA},Qm=D.createContext(wa),OA=(e,t)=>{if(e===t)return!0;if(!(e&&t))return e===t;let r=Object.keys(e),n=Object.keys(t);return r.length!==n.length?!1:r.every(a=>e[a]===t[a])},I1=({icons:e,children:t})=>{let r=D.useRef(e),n=D.useRef(e?{...wa,...e}:wa);OA(r.current,e)||(r.current=e,n.current=e?{...wa,...e}:wa);let a=n.current;return I.jsx(Qm.Provider,{value:a,children:t})},Qt=()=>D.useContext(Qm),Km={copyCode:"Copy Code",downloadFile:"Download file",downloadDiagram:"Download diagram",downloadDiagramAsSvg:"Download diagram as SVG",downloadDiagramAsPng:"Download diagram as PNG",downloadDiagramAsMmd:"Download diagram as MMD",viewFullscreen:"View fullscreen",exitFullscreen:"Exit fullscreen",mermaidFormatSvg:"SVG",mermaidFormatPng:"PNG",mermaidFormatMmd:"MMD",zoomIn:"Zoom in",zoomOut:"Zoom out",resetView:"Reset zoom and pan",copyTable:"Copy table",copyTableAsMarkdown:"Copy table as Markdown",copyTableAsCsv:"Copy table as CSV",copyTableAsTsv:"Copy table as TSV",downloadTable:"Download table",downloadTableAsCsv:"Download table as CSV",downloadTableAsMarkdown:"Download table as Markdown",tableFormatMarkdown:"Markdown",tableFormatCsv:"CSV",tableFormatTsv:"TSV",imageNotAvailable:"Image not available",downloadImage:"Download image",openExternalLink:"Open external link?",externalLinkWarning:"You're about to visit an external website.",close:"Close",copyLink:"Copy link",copied:"Copied",openLink:"Open link"},gu=D.createContext(Km),ur=()=>D.useContext(gu),bu=({onCopy:e,onError:t,timeout:r=2e3,children:n,className:a,code:i,...s})=>{let u=ve(),[l,o]=D.useState(!1),c=D.useRef(0),{code:h}=Xm(),{isAnimating:f}=D.useContext(ut),p=ur(),b=i??h,E=async()=>{var C;if(typeof window>"u"||!((C=navigator==null?void 0:navigator.clipboard)!=null&&C.writeText)){t==null||t(new Error("Clipboard API not available"));return}try{l||(await navigator.clipboard.writeText(b),o(!0),e==null||e(),c.current=window.setTimeout(()=>o(!1),r))}catch(w){t==null||t(w)}};D.useEffect(()=>()=>{window.clearTimeout(c.current)},[]);let T=Qt(),k=l?T.CheckIcon:T.CopyIcon;return I.jsxs(I.Fragment,{children:[I.jsx("button",{"aria-label":p.copyCode,className:u("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",a),"data-streamdown":"code-block-copy-button",disabled:f,onClick:E,title:p.copyCode,type:"button",...s,children:n??I.jsx(k,{"aria-hidden":"true",size:14})}),l&&I.jsx("output",{"aria-live":"polite",className:"sr-only",children:p.copied})]})},wl=(e,t,r)=>{if(typeof e=="boolean")return r;let n=e[t];if(typeof n!="object")return r;let a=n.download;return typeof a!="object"?r:a.filename||r},_1=(e,t)=>{if(typeof e=="boolean")return{};let r=e[t];if(typeof r!="object")return{};let n=r.copy;return typeof n!="object"||n===null?{}:{onCopy:n.onCopy,onError:n.onError}},N1={"1c":"1c","1c-query":"1cq",abap:"abap","actionscript-3":"as",ada:"ada",adoc:"adoc","angular-html":"html","angular-ts":"ts",apache:"conf",apex:"cls",apl:"apl",applescript:"applescript",ara:"ara",asciidoc:"adoc",asm:"asm",astro:"astro",awk:"awk",ballerina:"bal",bash:"sh",bat:"bat",batch:"bat",be:"be",beancount:"beancount",berry:"berry",bibtex:"bib",bicep:"bicep",blade:"blade.php",bsl:"bsl",c:"c","c#":"cs","c++":"cpp",cadence:"cdc",cairo:"cairo",cdc:"cdc",clarity:"clar",clj:"clj",clojure:"clj","closure-templates":"soy",cmake:"cmake",cmd:"cmd",cobol:"cob",codeowners:"CODEOWNERS",codeql:"ql",coffee:"coffee",coffeescript:"coffee","common-lisp":"lisp",console:"sh",coq:"v",cpp:"cpp",cql:"cql",crystal:"cr",cs:"cs",csharp:"cs",css:"css",csv:"csv",cue:"cue",cypher:"cql",d:"d",dart:"dart",dax:"dax",desktop:"desktop",diff:"diff",docker:"dockerfile",dockerfile:"dockerfile",dotenv:"env","dream-maker":"dm",edge:"edge",elisp:"el",elixir:"ex",elm:"elm","emacs-lisp":"el",erb:"erb",erl:"erl",erlang:"erl",f:"f","f#":"fs",f03:"f03",f08:"f08",f18:"f18",f77:"f77",f90:"f90",f95:"f95",fennel:"fnl",fish:"fish",fluent:"ftl",for:"for","fortran-fixed-form":"f","fortran-free-form":"f90",fs:"fs",fsharp:"fs",fsl:"fsl",ftl:"ftl",gdresource:"tres",gdscript:"gd",gdshader:"gdshader",genie:"gs",gherkin:"feature","git-commit":"gitcommit","git-rebase":"gitrebase",gjs:"js",gleam:"gleam","glimmer-js":"js","glimmer-ts":"ts",glsl:"glsl",gnuplot:"plt",go:"go",gql:"gql",graphql:"graphql",groovy:"groovy",gts:"gts",hack:"hack",haml:"haml",handlebars:"hbs",haskell:"hs",haxe:"hx",hbs:"hbs",hcl:"hcl",hjson:"hjson",hlsl:"hlsl",hs:"hs",html:"html","html-derivative":"html",http:"http",hxml:"hxml",hy:"hy",imba:"imba",ini:"ini",jade:"jade",java:"java",javascript:"js",jinja:"jinja",jison:"jison",jl:"jl",js:"js",json:"json",json5:"json5",jsonc:"jsonc",jsonl:"jsonl",jsonnet:"jsonnet",jssm:"jssm",jsx:"jsx",julia:"jl",kotlin:"kt",kql:"kql",kt:"kt",kts:"kts",kusto:"kql",latex:"tex",lean:"lean",lean4:"lean",less:"less",liquid:"liquid",lisp:"lisp",lit:"lit",llvm:"ll",log:"log",logo:"logo",lua:"lua",luau:"luau",make:"mak",makefile:"mak",markdown:"md",marko:"marko",matlab:"m",md:"md",mdc:"mdc",mdx:"mdx",mediawiki:"wiki",mermaid:"mmd",mips:"s",mipsasm:"s",mmd:"mmd",mojo:"mojo",move:"move",nar:"nar",narrat:"narrat",nextflow:"nf",nf:"nf",nginx:"conf",nim:"nim",nix:"nix",nu:"nu",nushell:"nu",objc:"m","objective-c":"m","objective-cpp":"mm",ocaml:"ml",pascal:"pas",perl:"pl",perl6:"p6",php:"php",plsql:"pls",po:"po",polar:"polar",postcss:"pcss",pot:"pot",potx:"potx",powerquery:"pq",powershell:"ps1",prisma:"prisma",prolog:"pl",properties:"properties",proto:"proto",protobuf:"proto",ps:"ps",ps1:"ps1",pug:"pug",puppet:"pp",purescript:"purs",py:"py",python:"py",ql:"ql",qml:"qml",qmldir:"qmldir",qss:"qss",r:"r",racket:"rkt",raku:"raku",razor:"cshtml",rb:"rb",reg:"reg",regex:"regex",regexp:"regexp",rel:"rel",riscv:"s",rs:"rs",rst:"rst",ruby:"rb",rust:"rs",sas:"sas",sass:"sass",scala:"scala",scheme:"scm",scss:"scss",sdbl:"sdbl",sh:"sh",shader:"shader",shaderlab:"shader",shell:"sh",shellscript:"sh",shellsession:"sh",smalltalk:"st",solidity:"sol",soy:"soy",sparql:"rq",spl:"spl",splunk:"spl",sql:"sql","ssh-config":"config",stata:"do",styl:"styl",stylus:"styl",svelte:"svelte",swift:"swift","system-verilog":"sv",systemd:"service",talon:"talon",talonscript:"talon",tasl:"tasl",tcl:"tcl",templ:"templ",terraform:"tf",tex:"tex",tf:"tf",tfvars:"tfvars",toml:"toml",ts:"ts","ts-tags":"ts",tsp:"tsp",tsv:"tsv",tsx:"tsx",turtle:"ttl",twig:"twig",typ:"typ",typescript:"ts",typespec:"tsp",typst:"typ",v:"v",vala:"vala",vb:"vb",verilog:"v",vhdl:"vhdl",vim:"vim",viml:"vim",vimscript:"vim",vue:"vue","vue-html":"html","vue-vine":"vine",vy:"vy",vyper:"vy",wasm:"wasm",wenyan:"wy",wgsl:"wgsl",wiki:"wiki",wikitext:"wiki",wit:"wit",wl:"wl",wolfram:"wl",xml:"xml",xsl:"xsl",yaml:"yaml",yml:"yml",zenscript:"zs",zig:"zig",zsh:"zsh",文言:"wy"},MA=({onDownload:e,onError:t,language:r,children:n,className:a,code:i,...s})=>{let u=ve(),{code:l}=Xm(),{isAnimating:o,controls:c}=D.useContext(ut),h=ur(),f=Qt(),p=i??l,b=r&&r in N1?N1[r]:"txt",E=`${wl(c,"code","file")}.${b}`,T="text/plain",k=()=>{try{Un(E,p,T),e==null||e()}catch(C){t==null||t(C)}};return I.jsx("button",{"aria-label":h.downloadFile,className:u("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",a),"data-streamdown":"code-block-download-button",disabled:o,onClick:k,title:h.downloadFile,type:"button",...s,children:n??I.jsx(f.DownloadIcon,{size:14})})},L1=()=>{let{Loader2Icon:e}=Qt(),t=ve();return I.jsxs("div",{className:t("w-full divide-y divide-border overflow-hidden rounded-xl border border-border"),children:[I.jsx("div",{className:t("h-[46px] w-full bg-muted/80")}),I.jsx("div",{className:t("flex w-full items-center justify-center p-4"),children:I.jsx(e,{className:t("size-4 animate-spin")})})]})},PA=/\.[^/.]+$/,BA=({node:e,className:t,src:r,alt:n,onLoad:a,onError:i,showControls:s=!0,showDownloadControl:u=!0,...l})=>{let{DownloadIcon:o}=Qt(),c=ve(),h=D.useRef(null),[f,p]=D.useState(!1),[b,E]=D.useState(!1),T=ur(),k=l.width!=null||l.height!=null,C=(f||k)&&!b&&s&&u,w=b&&!k;D.useEffect(()=>{let U=h.current;if(U!=null&&U.complete){let q=U.naturalWidth>0;p(q),E(!q)}},[]);let H=D.useCallback(U=>{p(!0),E(!1),a==null||a(U)},[a]),z=D.useCallback(U=>{p(!1),E(!0),i==null||i(U)},[i]),O=async()=>{if(r)try{let U=await(await fetch(r)).blob(),q=new URL(r,window.location.origin).pathname.split("/").pop()||"",G=q.split(".").pop(),P=q.includes(".")&&G!==void 0&&G.length<=4,K="";if(P)K=q;else{let j=U.type,ce="png";j.includes("jpeg")||j.includes("jpg")?ce="jpg":j.includes("png")?ce="png":j.includes("svg")?ce="svg":j.includes("gif")?ce="gif":j.includes("webp")&&(ce="webp"),K=`${(n||q||"image").replace(PA,"")}.${ce}`}Un(K,U,U.type)}catch{window.open(r,"_blank")}};return r?r===$a?I.jsx("div",{className:c("group relative my-4 inline-block"),"data-incomplete":"true","data-streamdown":"image-wrapper",children:I.jsx("div",{className:c("h-24 w-48 animate-pulse rounded-lg bg-muted"),"data-streamdown":"image-placeholder"})}):I.jsxs("div",{className:c("group relative my-4 inline-block"),"data-streamdown":"image-wrapper",children:[I.jsx("img",{alt:n,className:c("max-w-full rounded-lg",w&&"hidden",t),"data-streamdown":"image",onError:z,onLoad:H,ref:h,src:r,...l}),w&&I.jsx("span",{className:c("text-muted-foreground text-xs italic"),"data-streamdown":"image-fallback",children:T.imageNotAvailable}),s&&I.jsx("div",{className:c("pointer-events-none absolute inset-0 hidden rounded-lg bg-black/10 group-hover:block"),"data-streamdown":"image-overlay"}),C&&I.jsx("button",{className:c("absolute right-2 bottom-2 flex h-8 w-8 cursor-pointer items-center justify-center rounded-md border border-border bg-background/90 shadow-sm backdrop-blur-sm transition-all duration-200 hover:bg-background","opacity-0 group-hover:opacity-100"),onClick:O,title:T.downloadImage,type:"button",children:I.jsx(o,{size:14})})]}):null},Al=e=>{let t=typeof e=="function"?e():e;return t??document.body},Ma=0,Cl=()=>{Ma+=1,Ma===1&&(document.body.style.overflow="hidden")},Sl=()=>{Ma=Math.max(0,Ma-1),Ma===0&&(document.body.style.overflow="")},FA=({url:e,isOpen:t,onClose:r,onConfirm:n})=>{let{CheckIcon:a,CopyIcon:i,ExternalLinkIcon:s,XIcon:u}=Qt(),l=ve(),[o,c]=D.useState(!1),h=ur(),{portal:f}=D.useContext(ut),p=D.useCallback(async()=>{try{await navigator.clipboard.writeText(e),c(!0),setTimeout(()=>c(!1),2e3)}catch{}},[e]),b=D.useCallback(()=>{n(),r()},[n,r]);if(D.useEffect(()=>{if(t){Cl();let T=k=>{k.key==="Escape"&&r()};return document.addEventListener("keydown",T),()=>{document.removeEventListener("keydown",T),Sl()}}},[t,r]),!t||typeof document>"u")return null;let E=I.jsx("div",{className:l("fixed inset-0 z-50 flex items-center justify-center bg-background/50 backdrop-blur-sm"),"data-streamdown":"link-safety-modal",onClick:r,onKeyDown:T=>{T.key==="Escape"&&r()},role:"button",tabIndex:0,children:I.jsxs("div",{className:l("relative mx-4 flex w-full max-w-md flex-col gap-4 rounded-xl border bg-background p-6 shadow-lg"),onClick:T=>T.stopPropagation(),onKeyDown:T=>T.stopPropagation(),role:"presentation",children:[I.jsx("button",{className:l("absolute top-4 right-4 rounded-md p-1 text-muted-foreground transition-all hover:bg-muted hover:text-foreground"),onClick:r,title:h.close,type:"button",children:I.jsx(u,{size:16})}),I.jsxs("div",{className:l("flex flex-col gap-2"),children:[I.jsxs("div",{className:l("flex items-center gap-2 font-semibold text-lg"),children:[I.jsx(s,{size:20}),I.jsx("span",{children:h.openExternalLink})]}),I.jsx("p",{className:l("text-muted-foreground text-sm"),children:h.externalLinkWarning})]}),I.jsx("div",{className:l("break-all rounded-md bg-muted p-3 font-mono text-sm",e.length>100&&"max-h-32 overflow-y-auto"),children:e}),I.jsxs("div",{className:l("flex gap-2"),children:[I.jsx("button",{className:l("flex flex-1 items-center justify-center gap-2 rounded-md border bg-background px-4 py-2 font-medium text-sm transition-all hover:bg-muted"),onClick:p,type:"button",children:o?I.jsxs(I.Fragment,{children:[I.jsx(a,{size:14}),I.jsx("span",{children:h.copied})]}):I.jsxs(I.Fragment,{children:[I.jsx(i,{size:14}),I.jsx("span",{children:h.copyLink})]})}),I.jsxs("button",{className:l("flex flex-1 items-center justify-center gap-2 rounded-md bg-primary px-4 py-2 font-medium text-primary-foreground text-sm transition-all hover:bg-primary/90"),onClick:b,type:"button",children:[I.jsx(s,{size:14}),I.jsx("span",{children:h.openLink})]})]})]})});return Tu.createPortal(E,Al(f))},xu=D.createContext(null),Il=()=>D.useContext(xu),LS=()=>{var e;let t=Il();return(e=t==null?void 0:t.code)!=null?e:null},_l=()=>{var e;let t=Il();return(e=t==null?void 0:t.mermaid)!=null?e:null},HA=e=>{var t;let r=Il();return r!=null&&r.renderers&&e&&(t=r.renderers.find(n=>Array.isArray(n.language)?n.language.includes(e):n.language===e))!=null?t:null},Zm=/<svg\b[^>]*>/i,zA=/\bviewBox=(['"])(.*?)\1/i,$A=/[\s,]+/,UA=/\swidth=(['"]).*?\1/gi,qA=/\sheight=(['"]).*?\1/gi,R1=/\sstyle=(['"])(.*?)\1/i,jA=/^width\s*:/i,GA=/^height\s*:/i,VA=/^max-width\s*:/i,D1=/^<svg/i,Jm=e=>{let t=e.match(Zm);if(!t)return null;let r=t[0].match(zA),n=r==null?void 0:r[2];if(!n)return null;let a=n.trim().split($A).map(u=>Number.parseFloat(u));if(a.length<4||a.slice(0,4).some(Number.isNaN))return null;let i=a[2],s=a[3];return i>0&&s>0?{height:s,width:i}:null},YA=e=>{let t=e.match(Zm);if(!t)return e;try{let r=t[0],n=Jm(e);if(!n)return e;let{width:a,height:i}=n,s=r.replace(UA,"").replace(qA,""),u=s.match(R1),l=`width:${a}px;height:${i}px;max-width:none;`;if(u){let o=u[1],c=u[2].split(";").map(f=>f.trim()).filter(Boolean).filter(f=>!(jA.test(f)||GA.test(f)||VA.test(f))).join(";"),h=`${l}${c?`${c};`:""}`;s=s.replace(R1,` style=${o}${h}${o}`)}else s=s.replace(D1,`<svg style="${l}"`);return s=s.replace(D1,`<svg width="${a}" height="${i}"`),e.replace(r,s)}catch{return e}},WA=e=>{if(typeof DOMParser>"u"||typeof XMLSerializer>"u")return e;let t=new DOMParser().parseFromString(e,"text/html").querySelector("svg");return t?new XMLSerializer().serializeToString(t):e},XA=(e,t)=>{var r;let n=(r=void 0)!=null?r:5;return new Promise((a,i)=>{let s="data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(e))),u=new Image;u.crossOrigin="anonymous",u.onload=()=>{let l=document.createElement("canvas"),o=u.width*n,c=u.height*n;l.width=o,l.height=c;let h=l.getContext("2d");if(!h){i(new Error("Failed to create 2D canvas context for PNG export"));return}h.drawImage(u,0,0,o,c),l.toBlob(f=>{if(!f){i(new Error("Failed to create PNG blob"));return}a(f)},"image/png")},u.onerror=()=>i(new Error("Failed to load SVG image")),u.src=s})},ep=({chart:e,children:t,className:r,onDownload:n,config:a,onError:i})=>{let s=ve(),[u,l]=D.useState(!1),o=D.useRef(null),{isAnimating:c,controls:h}=D.useContext(ut),f=Qt(),p=_l(),b=ur(),E=wl(h,"mermaid","diagram"),T=async k=>{try{if(k==="mmd"){let U=`${E}.mmd`;Un(U,e,"text/plain"),l(!1),n==null||n(k);return}if(!p){i==null||i(new Error("Mermaid plugin not available"));return}let C=p.getMermaid(a),w=e.split("").reduce((U,q)=>(U<<5)-U+q.charCodeAt(0)|0,0),H=`mermaid-${Math.abs(w)}-${Date.now()}-${Math.random().toString(36).substring(2,9)}`,{svg:z}=await C.render(H,e);if(!z){i==null||i(new Error("SVG not found. Please wait for the diagram to render."));return}let O=WA(z);if(k==="svg"){let U=`${E}.svg`;Un(U,O,"image/svg+xml"),l(!1),n==null||n(k);return}if(k==="png"){let U=await XA(O);Un(`${E}.png`,U,"image/png"),n==null||n(k),l(!1);return}}catch(C){i==null||i(C)}};return D.useEffect(()=>{let k=C=>{let w=C.composedPath();o.current&&!w.includes(o.current)&&l(!1)};return document.addEventListener("mousedown",k),()=>{document.removeEventListener("mousedown",k)}},[]),I.jsxs("div",{className:s("relative"),ref:o,children:[I.jsx("button",{"aria-label":b.downloadDiagram,className:s("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",r),disabled:c,onClick:()=>l(!u),title:b.downloadDiagram,type:"button",children:t??I.jsx(f.DownloadIcon,{"aria-hidden":"true",size:14})}),u?I.jsxs("div",{className:s("absolute top-full right-0 z-10 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg"),children:[I.jsx("button",{"aria-label":b.downloadDiagramAsSvg,className:s("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>T("svg"),title:b.downloadDiagramAsSvg,type:"button",children:b.mermaidFormatSvg}),I.jsx("button",{"aria-label":b.downloadDiagramAsPng,className:s("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>T("png"),title:b.downloadDiagramAsPng,type:"button",children:b.mermaidFormatPng}),I.jsx("button",{"aria-label":b.downloadDiagramAsMmd,className:s("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>T("mmd"),title:b.downloadDiagramAsMmd,type:"button",children:b.mermaidFormatMmd})]}):null]})},QA=({chart:e,config:t,onFullscreen:r,onExit:n,className:a,...i})=>{let{Maximize2Icon:s,XIcon:u}=Qt(),l=ve(),[o,c]=D.useState(!1),{isAnimating:h,controls:f,portal:p}=D.useContext(ut),b=ur(),E=(()=>{if(typeof f=="boolean")return f;let w=f.mermaid;return w===!1?!1:w===!0||w===void 0?!0:w.panZoom!==!1})(),T=(()=>{if(typeof f=="boolean")return f;let w=f.mermaid;return w===!1?!1:w===!0||w===void 0?!0:w.download!==!1})(),k=(()=>{if(typeof f=="boolean")return f;let w=f.mermaid;return w===!1?!1:w===!0||w===void 0?!0:w.copy!==!1})(),C=()=>{c(!o)};return D.useEffect(()=>{if(o){Cl();let w=H=>{H.key==="Escape"&&c(!1)};return document.addEventListener("keydown",w),()=>{document.removeEventListener("keydown",w),Sl()}}},[o]),D.useEffect(()=>{o?r==null||r():n&&n()},[o,r,n]),I.jsxs(I.Fragment,{children:[I.jsx("button",{className:l("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",a),disabled:h,onClick:C,title:b.viewFullscreen,type:"button",...i,"aria-label":b.viewFullscreen,children:I.jsx(s,{"aria-hidden":"true",size:14})}),o?Tu.createPortal(I.jsxs("div",{"aria-label":b.viewFullscreen,"aria-modal":"true",className:l("fixed inset-0 z-50 flex items-center justify-center bg-background/95 backdrop-blur-sm"),"data-streamdown":"mermaid-fullscreen",onClick:C,onKeyDown:w=>{w.key==="Escape"&&C()},role:"dialog",children:[I.jsxs("div",{className:l("absolute top-4 right-4 z-10 flex items-center gap-1"),onClick:w=>w.stopPropagation(),onKeyDown:w=>w.stopPropagation(),role:"presentation",children:[T?I.jsx(ep,{chart:e,config:t}):null,k?I.jsx(bu,{code:e}):null,I.jsx("button",{"aria-label":b.exitFullscreen,className:l("rounded-md p-2 text-muted-foreground transition-all hover:bg-muted hover:text-foreground"),onClick:C,title:b.exitFullscreen,type:"button",children:I.jsx(u,{"aria-hidden":"true",size:20})})]}),I.jsx("div",{className:l("flex size-full items-center justify-center p-4"),onClick:w=>w.stopPropagation(),onKeyDown:w=>w.stopPropagation(),role:"presentation",children:I.jsx(Up,{chart:e,className:l("size-full [&_svg]:h-auto [&_svg]:w-auto"),config:t,fullscreen:!0,showControls:E})})]}),Al(p)):null]})};function Eu(e){var t;if(e.nodeType===Node.TEXT_NODE)return(t=e.textContent)!=null?t:"";if(e.nodeType!==Node.ELEMENT_NODE)return"";let r=e;return r.tagName==="BR"?`
|
|
526
|
+
`;)t--;return e.slice(0,t)},vA=D.lazy(()=>J1(()=>import("./highlighted-body-KQOG7T2V-BPvcfizq.js"),__vite__mapDeps([0,1,2,3,4,5,6])).then(e=>({default:e.HighlightedCodeBlockBody}))),kA=({code:e,language:t,className:r,children:n,isIncomplete:a=!1,startLine:i,lineNumbers:s,...u})=>{let l=ve(),{codeBlockMaxHeight:o}=D.useContext(ut),c=D.useMemo(()=>TA(e),[e]),h=D.useMemo(()=>({bg:"transparent",fg:"inherit",tokens:c.split(`
|
|
527
|
+
`).map(f=>[{content:f,color:"inherit",bgColor:"transparent",htmlStyle:{},offset:0}])}),[c]);return I.jsx(Wm.Provider,{value:{code:e},children:I.jsxs(EA,{dir:"ltr",isIncomplete:a,language:t,children:[I.jsx(yA,{language:t}),n?I.jsx("div",{className:l("pointer-events-none absolute top-2 right-2 z-10 flex items-center"),children:I.jsx("div",{className:l("pointer-events-auto flex shrink-0 items-center gap-2 rounded-md border border-sidebar bg-sidebar/80 px-1.5 py-1 supports-[backdrop-filter]:bg-sidebar/70 supports-[backdrop-filter]:backdrop-blur"),"data-streamdown":"code-block-actions",children:n})}):null,I.jsx(D.Suspense,{fallback:I.jsx(xA,{className:r,language:t,lineNumbers:s,maxHeight:o,result:h,startLine:i,...u}),children:I.jsx(vA,{className:r,code:c,isIncomplete:a,language:t,lineNumbers:s,maxHeight:o,raw:h,startLine:i,...u})})]})})},wA=e=>I.jsx("svg",{"aria-hidden":"true",color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:I.jsx("path",{clipRule:"evenodd",d:"M15.5607 3.99999L15.0303 4.53032L6.23744 13.3232C5.55403 14.0066 4.44599 14.0066 3.76257 13.3232L4.2929 12.7929L3.76257 13.3232L0.969676 10.5303L0.439346 9.99999L1.50001 8.93933L2.03034 9.46966L4.82323 12.2626C4.92086 12.3602 5.07915 12.3602 5.17678 12.2626L13.9697 3.46966L14.5 2.93933L15.5607 3.99999Z",fill:"currentColor",fillRule:"evenodd"})}),AA=e=>I.jsx("svg",{"aria-hidden":"true",color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:I.jsx("path",{clipRule:"evenodd",d:"M2.75 0.5C1.7835 0.5 1 1.2835 1 2.25V9.75C1 10.7165 1.7835 11.5 2.75 11.5H3.75H4.5V10H3.75H2.75C2.61193 10 2.5 9.88807 2.5 9.75V2.25C2.5 2.11193 2.61193 2 2.75 2H8.25C8.38807 2 8.5 2.11193 8.5 2.25V3H10V2.25C10 1.2835 9.2165 0.5 8.25 0.5H2.75ZM7.75 4.5C6.7835 4.5 6 5.2835 6 6.25V13.75C6 14.7165 6.7835 15.5 7.75 15.5H13.25C14.2165 15.5 15 14.7165 15 13.75V6.25C15 5.2835 14.2165 4.5 13.25 4.5H7.75ZM7.5 6.25C7.5 6.11193 7.61193 6 7.75 6H13.25C13.3881 6 13.5 6.11193 13.5 6.25V13.75C13.5 13.8881 13.3881 14 13.25 14H7.75C7.61193 14 7.5 13.8881 7.5 13.75V6.25Z",fill:"currentColor",fillRule:"evenodd"})}),CA=e=>I.jsx("svg",{"aria-hidden":"true",color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:I.jsx("path",{clipRule:"evenodd",d:"M8.75 1V1.75V8.68934L10.7197 6.71967L11.25 6.18934L12.3107 7.25L11.7803 7.78033L8.70711 10.8536C8.31658 11.2441 7.68342 11.2441 7.29289 10.8536L4.21967 7.78033L3.68934 7.25L4.75 6.18934L5.28033 6.71967L7.25 8.68934V1.75V1H8.75ZM13.5 9.25V13.5H2.5V9.25V8.5H1V9.25V14C1 14.5523 1.44771 15 2 15H14C14.5523 15 15 14.5523 15 14V9.25V8.5H13.5V9.25Z",fill:"currentColor",fillRule:"evenodd"})}),SA=e=>I.jsxs("svg",{"aria-hidden":"true",color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:[I.jsx("path",{d:"M8 0V4",stroke:"currentColor",strokeWidth:"1.5"}),I.jsx("path",{d:"M8 16V12",opacity:"0.5",stroke:"currentColor",strokeWidth:"1.5"}),I.jsx("path",{d:"M3.29773 1.52783L5.64887 4.7639",opacity:"0.9",stroke:"currentColor",strokeWidth:"1.5"}),I.jsx("path",{d:"M12.7023 1.52783L10.3511 4.7639",opacity:"0.1",stroke:"currentColor",strokeWidth:"1.5"}),I.jsx("path",{d:"M12.7023 14.472L10.3511 11.236",opacity:"0.4",stroke:"currentColor",strokeWidth:"1.5"}),I.jsx("path",{d:"M3.29773 14.472L5.64887 11.236",opacity:"0.6",stroke:"currentColor",strokeWidth:"1.5"}),I.jsx("path",{d:"M15.6085 5.52783L11.8043 6.7639",opacity:"0.2",stroke:"currentColor",strokeWidth:"1.5"}),I.jsx("path",{d:"M0.391602 10.472L4.19583 9.23598",opacity:"0.7",stroke:"currentColor",strokeWidth:"1.5"}),I.jsx("path",{d:"M15.6085 10.4722L11.8043 9.2361",opacity:"0.3",stroke:"currentColor",strokeWidth:"1.5"}),I.jsx("path",{d:"M0.391602 5.52783L4.19583 6.7639",opacity:"0.8",stroke:"currentColor",strokeWidth:"1.5"})]}),IA=e=>I.jsx("svg",{"aria-hidden":"true",color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:I.jsx("path",{clipRule:"evenodd",d:"M1 5.25V6H2.5V5.25V2.5H5.25H6V1H5.25H2C1.44772 1 1 1.44772 1 2V5.25ZM5.25 14.9994H6V13.4994H5.25H2.5V10.7494V9.99939H1V10.7494V13.9994C1 14.5517 1.44772 14.9994 2 14.9994H5.25ZM15 10V10.75V14C15 14.5523 14.5523 15 14 15H10.75H10V13.5H10.75H13.5V10.75V10H15ZM10.75 1H10V2.5H10.75H13.5V5.25V6H15V5.25V2C15 1.44772 14.5523 1 14 1H10.75Z",fill:"currentColor",fillRule:"evenodd"})}),_A=e=>I.jsx("svg",{"aria-hidden":"true",color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:I.jsx("path",{clipRule:"evenodd",d:"M13.5 8C13.5 4.96643 11.0257 2.5 7.96452 2.5C5.42843 2.5 3.29365 4.19393 2.63724 6.5H5.25H6V8H5.25H0.75C0.335787 8 0 7.66421 0 7.25V2.75V2H1.5V2.75V5.23347C2.57851 2.74164 5.06835 1 7.96452 1C11.8461 1 15 4.13001 15 8C15 11.87 11.8461 15 7.96452 15C5.62368 15 3.54872 13.8617 2.27046 12.1122L1.828 11.5066L3.03915 10.6217L3.48161 11.2273C4.48831 12.6051 6.12055 13.5 7.96452 13.5C11.0257 13.5 13.5 11.0336 13.5 8Z",fill:"currentColor",fillRule:"evenodd"})}),NA=e=>I.jsx("svg",{"aria-hidden":"true",color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:I.jsx("path",{clipRule:"evenodd",d:"M12.4697 13.5303L13 14.0607L14.0607 13L13.5303 12.4697L9.06065 7.99999L13.5303 3.53032L14.0607 2.99999L13 1.93933L12.4697 2.46966L7.99999 6.93933L3.53032 2.46966L2.99999 1.93933L1.93933 2.99999L2.46966 3.53032L6.93933 7.99999L2.46966 12.4697L1.93933 13L2.99999 14.0607L3.53032 13.5303L7.99999 9.06065L12.4697 13.5303Z",fill:"currentColor",fillRule:"evenodd"})}),LA=e=>I.jsx("svg",{"aria-hidden":"true",color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:I.jsx("path",{clipRule:"evenodd",d:"M13.5 10.25V13.25C13.5 13.3881 13.3881 13.5 13.25 13.5H2.75C2.61193 13.5 2.5 13.3881 2.5 13.25L2.5 2.75C2.5 2.61193 2.61193 2.5 2.75 2.5H5.75H6.5V1H5.75H2.75C1.7835 1 1 1.7835 1 2.75V13.25C1 14.2165 1.7835 15 2.75 15H13.25C14.2165 15 15 14.2165 15 13.25V10.25V9.5H13.5V10.25ZM9 1H9.75H14.2495C14.6637 1 14.9995 1.33579 14.9995 1.75V6.25V7H13.4995V6.25V3.56066L8.53033 8.52978L8 9.06011L6.93934 7.99945L7.46967 7.46912L12.4388 2.5H9.75H9V1Z",fill:"currentColor",fillRule:"evenodd"})}),RA=e=>I.jsx("svg",{"aria-hidden":"true",color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:I.jsx("path",{clipRule:"evenodd",d:"M1.5 6.5C1.5 3.73858 3.73858 1.5 6.5 1.5C9.26142 1.5 11.5 3.73858 11.5 6.5C11.5 9.26142 9.26142 11.5 6.5 11.5C3.73858 11.5 1.5 9.26142 1.5 6.5ZM6.5 0C2.91015 0 0 2.91015 0 6.5C0 10.0899 2.91015 13 6.5 13C8.02469 13 9.42677 12.475 10.5353 11.596L13.9697 15.0303L14.5 15.5607L15.5607 14.5L15.0303 13.9697L11.596 10.5353C12.475 9.42677 13 8.02469 13 6.5C13 2.91015 10.0899 0 6.5 0ZM4.125 5.875H4.75H5.875V4.75V4.125H7.125V4.75V5.875H8.25H8.875V7.125H8.25H7.125V8.25V8.875H5.875V8.25V7.125H4.75H4.125V5.875Z",fill:"currentColor",fillRule:"evenodd"})}),DA=e=>I.jsx("svg",{"aria-hidden":"true",color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:I.jsx("path",{clipRule:"evenodd",d:"M1.5 6.5C1.5 3.73858 3.73858 1.5 6.5 1.5C9.26142 1.5 11.5 3.73858 11.5 6.5C11.5 9.26142 9.26142 11.5 6.5 11.5C3.73858 11.5 1.5 9.26142 1.5 6.5ZM6.5 0C2.91015 0 0 2.91015 0 6.5C0 10.0899 2.91015 13 6.5 13C8.02469 13 9.42677 12.475 10.5353 11.596L13.9697 15.0303L14.5 15.5607L15.5607 14.5L15.0303 13.9697L11.596 10.5353C12.475 9.42677 13 8.02469 13 6.5C13 2.91015 10.0899 0 6.5 0ZM4.125 5.875H4.75H8.25H8.875V7.125H8.25H4.75H4.125V5.875Z",fill:"currentColor",fillRule:"evenodd"})}),wa={CheckIcon:wA,CopyIcon:AA,DownloadIcon:CA,ExternalLinkIcon:LA,Loader2Icon:SA,Maximize2Icon:IA,RotateCcwIcon:_A,XIcon:NA,ZoomInIcon:RA,ZoomOutIcon:DA},Qm=D.createContext(wa),OA=(e,t)=>{if(e===t)return!0;if(!(e&&t))return e===t;let r=Object.keys(e),n=Object.keys(t);return r.length!==n.length?!1:r.every(a=>e[a]===t[a])},I1=({icons:e,children:t})=>{let r=D.useRef(e),n=D.useRef(e?{...wa,...e}:wa);OA(r.current,e)||(r.current=e,n.current=e?{...wa,...e}:wa);let a=n.current;return I.jsx(Qm.Provider,{value:a,children:t})},Qt=()=>D.useContext(Qm),Km={copyCode:"Copy Code",downloadFile:"Download file",downloadDiagram:"Download diagram",downloadDiagramAsSvg:"Download diagram as SVG",downloadDiagramAsPng:"Download diagram as PNG",downloadDiagramAsMmd:"Download diagram as MMD",viewFullscreen:"View fullscreen",exitFullscreen:"Exit fullscreen",mermaidFormatSvg:"SVG",mermaidFormatPng:"PNG",mermaidFormatMmd:"MMD",zoomIn:"Zoom in",zoomOut:"Zoom out",resetView:"Reset zoom and pan",copyTable:"Copy table",copyTableAsMarkdown:"Copy table as Markdown",copyTableAsCsv:"Copy table as CSV",copyTableAsTsv:"Copy table as TSV",downloadTable:"Download table",downloadTableAsCsv:"Download table as CSV",downloadTableAsMarkdown:"Download table as Markdown",tableFormatMarkdown:"Markdown",tableFormatCsv:"CSV",tableFormatTsv:"TSV",imageNotAvailable:"Image not available",downloadImage:"Download image",openExternalLink:"Open external link?",externalLinkWarning:"You're about to visit an external website.",close:"Close",copyLink:"Copy link",copied:"Copied",openLink:"Open link"},gu=D.createContext(Km),ur=()=>D.useContext(gu),bu=({onCopy:e,onError:t,timeout:r=2e3,children:n,className:a,code:i,...s})=>{let u=ve(),[l,o]=D.useState(!1),c=D.useRef(0),{code:h}=Xm(),{isAnimating:f}=D.useContext(ut),p=ur(),b=i??h,E=async()=>{var C;if(typeof window>"u"||!((C=navigator==null?void 0:navigator.clipboard)!=null&&C.writeText)){t==null||t(new Error("Clipboard API not available"));return}try{l||(await navigator.clipboard.writeText(b),o(!0),e==null||e(),c.current=window.setTimeout(()=>o(!1),r))}catch(w){t==null||t(w)}};D.useEffect(()=>()=>{window.clearTimeout(c.current)},[]);let T=Qt(),k=l?T.CheckIcon:T.CopyIcon;return I.jsxs(I.Fragment,{children:[I.jsx("button",{"aria-label":p.copyCode,className:u("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",a),"data-streamdown":"code-block-copy-button",disabled:f,onClick:E,title:p.copyCode,type:"button",...s,children:n??I.jsx(k,{"aria-hidden":"true",size:14})}),l&&I.jsx("output",{"aria-live":"polite",className:"sr-only",children:p.copied})]})},wl=(e,t,r)=>{if(typeof e=="boolean")return r;let n=e[t];if(typeof n!="object")return r;let a=n.download;return typeof a!="object"?r:a.filename||r},_1=(e,t)=>{if(typeof e=="boolean")return{};let r=e[t];if(typeof r!="object")return{};let n=r.copy;return typeof n!="object"||n===null?{}:{onCopy:n.onCopy,onError:n.onError}},N1={"1c":"1c","1c-query":"1cq",abap:"abap","actionscript-3":"as",ada:"ada",adoc:"adoc","angular-html":"html","angular-ts":"ts",apache:"conf",apex:"cls",apl:"apl",applescript:"applescript",ara:"ara",asciidoc:"adoc",asm:"asm",astro:"astro",awk:"awk",ballerina:"bal",bash:"sh",bat:"bat",batch:"bat",be:"be",beancount:"beancount",berry:"berry",bibtex:"bib",bicep:"bicep",blade:"blade.php",bsl:"bsl",c:"c","c#":"cs","c++":"cpp",cadence:"cdc",cairo:"cairo",cdc:"cdc",clarity:"clar",clj:"clj",clojure:"clj","closure-templates":"soy",cmake:"cmake",cmd:"cmd",cobol:"cob",codeowners:"CODEOWNERS",codeql:"ql",coffee:"coffee",coffeescript:"coffee","common-lisp":"lisp",console:"sh",coq:"v",cpp:"cpp",cql:"cql",crystal:"cr",cs:"cs",csharp:"cs",css:"css",csv:"csv",cue:"cue",cypher:"cql",d:"d",dart:"dart",dax:"dax",desktop:"desktop",diff:"diff",docker:"dockerfile",dockerfile:"dockerfile",dotenv:"env","dream-maker":"dm",edge:"edge",elisp:"el",elixir:"ex",elm:"elm","emacs-lisp":"el",erb:"erb",erl:"erl",erlang:"erl",f:"f","f#":"fs",f03:"f03",f08:"f08",f18:"f18",f77:"f77",f90:"f90",f95:"f95",fennel:"fnl",fish:"fish",fluent:"ftl",for:"for","fortran-fixed-form":"f","fortran-free-form":"f90",fs:"fs",fsharp:"fs",fsl:"fsl",ftl:"ftl",gdresource:"tres",gdscript:"gd",gdshader:"gdshader",genie:"gs",gherkin:"feature","git-commit":"gitcommit","git-rebase":"gitrebase",gjs:"js",gleam:"gleam","glimmer-js":"js","glimmer-ts":"ts",glsl:"glsl",gnuplot:"plt",go:"go",gql:"gql",graphql:"graphql",groovy:"groovy",gts:"gts",hack:"hack",haml:"haml",handlebars:"hbs",haskell:"hs",haxe:"hx",hbs:"hbs",hcl:"hcl",hjson:"hjson",hlsl:"hlsl",hs:"hs",html:"html","html-derivative":"html",http:"http",hxml:"hxml",hy:"hy",imba:"imba",ini:"ini",jade:"jade",java:"java",javascript:"js",jinja:"jinja",jison:"jison",jl:"jl",js:"js",json:"json",json5:"json5",jsonc:"jsonc",jsonl:"jsonl",jsonnet:"jsonnet",jssm:"jssm",jsx:"jsx",julia:"jl",kotlin:"kt",kql:"kql",kt:"kt",kts:"kts",kusto:"kql",latex:"tex",lean:"lean",lean4:"lean",less:"less",liquid:"liquid",lisp:"lisp",lit:"lit",llvm:"ll",log:"log",logo:"logo",lua:"lua",luau:"luau",make:"mak",makefile:"mak",markdown:"md",marko:"marko",matlab:"m",md:"md",mdc:"mdc",mdx:"mdx",mediawiki:"wiki",mermaid:"mmd",mips:"s",mipsasm:"s",mmd:"mmd",mojo:"mojo",move:"move",nar:"nar",narrat:"narrat",nextflow:"nf",nf:"nf",nginx:"conf",nim:"nim",nix:"nix",nu:"nu",nushell:"nu",objc:"m","objective-c":"m","objective-cpp":"mm",ocaml:"ml",pascal:"pas",perl:"pl",perl6:"p6",php:"php",plsql:"pls",po:"po",polar:"polar",postcss:"pcss",pot:"pot",potx:"potx",powerquery:"pq",powershell:"ps1",prisma:"prisma",prolog:"pl",properties:"properties",proto:"proto",protobuf:"proto",ps:"ps",ps1:"ps1",pug:"pug",puppet:"pp",purescript:"purs",py:"py",python:"py",ql:"ql",qml:"qml",qmldir:"qmldir",qss:"qss",r:"r",racket:"rkt",raku:"raku",razor:"cshtml",rb:"rb",reg:"reg",regex:"regex",regexp:"regexp",rel:"rel",riscv:"s",rs:"rs",rst:"rst",ruby:"rb",rust:"rs",sas:"sas",sass:"sass",scala:"scala",scheme:"scm",scss:"scss",sdbl:"sdbl",sh:"sh",shader:"shader",shaderlab:"shader",shell:"sh",shellscript:"sh",shellsession:"sh",smalltalk:"st",solidity:"sol",soy:"soy",sparql:"rq",spl:"spl",splunk:"spl",sql:"sql","ssh-config":"config",stata:"do",styl:"styl",stylus:"styl",svelte:"svelte",swift:"swift","system-verilog":"sv",systemd:"service",talon:"talon",talonscript:"talon",tasl:"tasl",tcl:"tcl",templ:"templ",terraform:"tf",tex:"tex",tf:"tf",tfvars:"tfvars",toml:"toml",ts:"ts","ts-tags":"ts",tsp:"tsp",tsv:"tsv",tsx:"tsx",turtle:"ttl",twig:"twig",typ:"typ",typescript:"ts",typespec:"tsp",typst:"typ",v:"v",vala:"vala",vb:"vb",verilog:"v",vhdl:"vhdl",vim:"vim",viml:"vim",vimscript:"vim",vue:"vue","vue-html":"html","vue-vine":"vine",vy:"vy",vyper:"vy",wasm:"wasm",wenyan:"wy",wgsl:"wgsl",wiki:"wiki",wikitext:"wiki",wit:"wit",wl:"wl",wolfram:"wl",xml:"xml",xsl:"xsl",yaml:"yaml",yml:"yml",zenscript:"zs",zig:"zig",zsh:"zsh",文言:"wy"},MA=({onDownload:e,onError:t,language:r,children:n,className:a,code:i,...s})=>{let u=ve(),{code:l}=Xm(),{isAnimating:o,controls:c}=D.useContext(ut),h=ur(),f=Qt(),p=i??l,b=r&&r in N1?N1[r]:"txt",E=`${wl(c,"code","file")}.${b}`,T="text/plain",k=()=>{try{Un(E,p,T),e==null||e()}catch(C){t==null||t(C)}};return I.jsx("button",{"aria-label":h.downloadFile,className:u("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",a),"data-streamdown":"code-block-download-button",disabled:o,onClick:k,title:h.downloadFile,type:"button",...s,children:n??I.jsx(f.DownloadIcon,{size:14})})},L1=()=>{let{Loader2Icon:e}=Qt(),t=ve();return I.jsxs("div",{className:t("w-full divide-y divide-border overflow-hidden rounded-xl border border-border"),children:[I.jsx("div",{className:t("h-[46px] w-full bg-muted/80")}),I.jsx("div",{className:t("flex w-full items-center justify-center p-4"),children:I.jsx(e,{className:t("size-4 animate-spin")})})]})},PA=/\.[^/.]+$/,BA=({node:e,className:t,src:r,alt:n,onLoad:a,onError:i,showControls:s=!0,showDownloadControl:u=!0,...l})=>{let{DownloadIcon:o}=Qt(),c=ve(),h=D.useRef(null),[f,p]=D.useState(!1),[b,E]=D.useState(!1),T=ur(),k=l.width!=null||l.height!=null,C=(f||k)&&!b&&s&&u,w=b&&!k;D.useEffect(()=>{let U=h.current;if(U!=null&&U.complete){let q=U.naturalWidth>0;p(q),E(!q)}},[]);let H=D.useCallback(U=>{p(!0),E(!1),a==null||a(U)},[a]),z=D.useCallback(U=>{p(!1),E(!0),i==null||i(U)},[i]),O=async()=>{if(r)try{let U=await(await fetch(r)).blob(),q=new URL(r,window.location.origin).pathname.split("/").pop()||"",G=q.split(".").pop(),P=q.includes(".")&&G!==void 0&&G.length<=4,K="";if(P)K=q;else{let j=U.type,ce="png";j.includes("jpeg")||j.includes("jpg")?ce="jpg":j.includes("png")?ce="png":j.includes("svg")?ce="svg":j.includes("gif")?ce="gif":j.includes("webp")&&(ce="webp"),K=`${(n||q||"image").replace(PA,"")}.${ce}`}Un(K,U,U.type)}catch{window.open(r,"_blank")}};return r?r===$a?I.jsx("div",{className:c("group relative my-4 inline-block"),"data-incomplete":"true","data-streamdown":"image-wrapper",children:I.jsx("div",{className:c("h-24 w-48 animate-pulse rounded-lg bg-muted"),"data-streamdown":"image-placeholder"})}):I.jsxs("div",{className:c("group relative my-4 inline-block"),"data-streamdown":"image-wrapper",children:[I.jsx("img",{alt:n,className:c("max-w-full rounded-lg",w&&"hidden",t),"data-streamdown":"image",onError:z,onLoad:H,ref:h,src:r,...l}),w&&I.jsx("span",{className:c("text-muted-foreground text-xs italic"),"data-streamdown":"image-fallback",children:T.imageNotAvailable}),s&&I.jsx("div",{className:c("pointer-events-none absolute inset-0 hidden rounded-lg bg-black/10 group-hover:block"),"data-streamdown":"image-overlay"}),C&&I.jsx("button",{className:c("absolute right-2 bottom-2 flex h-8 w-8 cursor-pointer items-center justify-center rounded-md border border-border bg-background/90 shadow-sm backdrop-blur-sm transition-all duration-200 hover:bg-background","opacity-0 group-hover:opacity-100"),onClick:O,title:T.downloadImage,type:"button",children:I.jsx(o,{size:14})})]}):null},Al=e=>{let t=typeof e=="function"?e():e;return t??document.body},Ma=0,Cl=()=>{Ma+=1,Ma===1&&(document.body.style.overflow="hidden")},Sl=()=>{Ma=Math.max(0,Ma-1),Ma===0&&(document.body.style.overflow="")},FA=({url:e,isOpen:t,onClose:r,onConfirm:n})=>{let{CheckIcon:a,CopyIcon:i,ExternalLinkIcon:s,XIcon:u}=Qt(),l=ve(),[o,c]=D.useState(!1),h=ur(),{portal:f}=D.useContext(ut),p=D.useCallback(async()=>{try{await navigator.clipboard.writeText(e),c(!0),setTimeout(()=>c(!1),2e3)}catch{}},[e]),b=D.useCallback(()=>{n(),r()},[n,r]);if(D.useEffect(()=>{if(t){Cl();let T=k=>{k.key==="Escape"&&r()};return document.addEventListener("keydown",T),()=>{document.removeEventListener("keydown",T),Sl()}}},[t,r]),!t||typeof document>"u")return null;let E=I.jsx("div",{className:l("fixed inset-0 z-50 flex items-center justify-center bg-background/50 backdrop-blur-sm"),"data-streamdown":"link-safety-modal",onClick:r,onKeyDown:T=>{T.key==="Escape"&&r()},role:"button",tabIndex:0,children:I.jsxs("div",{className:l("relative mx-4 flex w-full max-w-md flex-col gap-4 rounded-xl border bg-background p-6 shadow-lg"),onClick:T=>T.stopPropagation(),onKeyDown:T=>T.stopPropagation(),role:"presentation",children:[I.jsx("button",{className:l("absolute top-4 right-4 rounded-md p-1 text-muted-foreground transition-all hover:bg-muted hover:text-foreground"),onClick:r,title:h.close,type:"button",children:I.jsx(u,{size:16})}),I.jsxs("div",{className:l("flex flex-col gap-2"),children:[I.jsxs("div",{className:l("flex items-center gap-2 font-semibold text-lg"),children:[I.jsx(s,{size:20}),I.jsx("span",{children:h.openExternalLink})]}),I.jsx("p",{className:l("text-muted-foreground text-sm"),children:h.externalLinkWarning})]}),I.jsx("div",{className:l("break-all rounded-md bg-muted p-3 font-mono text-sm",e.length>100&&"max-h-32 overflow-y-auto"),children:e}),I.jsxs("div",{className:l("flex gap-2"),children:[I.jsx("button",{className:l("flex flex-1 items-center justify-center gap-2 rounded-md border bg-background px-4 py-2 font-medium text-sm transition-all hover:bg-muted"),onClick:p,type:"button",children:o?I.jsxs(I.Fragment,{children:[I.jsx(a,{size:14}),I.jsx("span",{children:h.copied})]}):I.jsxs(I.Fragment,{children:[I.jsx(i,{size:14}),I.jsx("span",{children:h.copyLink})]})}),I.jsxs("button",{className:l("flex flex-1 items-center justify-center gap-2 rounded-md bg-primary px-4 py-2 font-medium text-primary-foreground text-sm transition-all hover:bg-primary/90"),onClick:b,type:"button",children:[I.jsx(s,{size:14}),I.jsx("span",{children:h.openLink})]})]})]})});return Tu.createPortal(E,Al(f))},xu=D.createContext(null),Il=()=>D.useContext(xu),NS=()=>{var e;let t=Il();return(e=t==null?void 0:t.code)!=null?e:null},_l=()=>{var e;let t=Il();return(e=t==null?void 0:t.mermaid)!=null?e:null},HA=e=>{var t;let r=Il();return r!=null&&r.renderers&&e&&(t=r.renderers.find(n=>Array.isArray(n.language)?n.language.includes(e):n.language===e))!=null?t:null},Zm=/<svg\b[^>]*>/i,zA=/\bviewBox=(['"])(.*?)\1/i,$A=/[\s,]+/,UA=/\swidth=(['"]).*?\1/gi,qA=/\sheight=(['"]).*?\1/gi,R1=/\sstyle=(['"])(.*?)\1/i,jA=/^width\s*:/i,GA=/^height\s*:/i,VA=/^max-width\s*:/i,D1=/^<svg/i,Jm=e=>{let t=e.match(Zm);if(!t)return null;let r=t[0].match(zA),n=r==null?void 0:r[2];if(!n)return null;let a=n.trim().split($A).map(u=>Number.parseFloat(u));if(a.length<4||a.slice(0,4).some(Number.isNaN))return null;let i=a[2],s=a[3];return i>0&&s>0?{height:s,width:i}:null},YA=e=>{let t=e.match(Zm);if(!t)return e;try{let r=t[0],n=Jm(e);if(!n)return e;let{width:a,height:i}=n,s=r.replace(UA,"").replace(qA,""),u=s.match(R1),l=`width:${a}px;height:${i}px;max-width:none;`;if(u){let o=u[1],c=u[2].split(";").map(f=>f.trim()).filter(Boolean).filter(f=>!(jA.test(f)||GA.test(f)||VA.test(f))).join(";"),h=`${l}${c?`${c};`:""}`;s=s.replace(R1,` style=${o}${h}${o}`)}else s=s.replace(D1,`<svg style="${l}"`);return s=s.replace(D1,`<svg width="${a}" height="${i}"`),e.replace(r,s)}catch{return e}},WA=e=>{if(typeof DOMParser>"u"||typeof XMLSerializer>"u")return e;let t=new DOMParser().parseFromString(e,"text/html").querySelector("svg");return t?new XMLSerializer().serializeToString(t):e},XA=(e,t)=>{var r;let n=(r=void 0)!=null?r:5;return new Promise((a,i)=>{let s="data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(e))),u=new Image;u.crossOrigin="anonymous",u.onload=()=>{let l=document.createElement("canvas"),o=u.width*n,c=u.height*n;l.width=o,l.height=c;let h=l.getContext("2d");if(!h){i(new Error("Failed to create 2D canvas context for PNG export"));return}h.drawImage(u,0,0,o,c),l.toBlob(f=>{if(!f){i(new Error("Failed to create PNG blob"));return}a(f)},"image/png")},u.onerror=()=>i(new Error("Failed to load SVG image")),u.src=s})},ep=({chart:e,children:t,className:r,onDownload:n,config:a,onError:i})=>{let s=ve(),[u,l]=D.useState(!1),o=D.useRef(null),{isAnimating:c,controls:h}=D.useContext(ut),f=Qt(),p=_l(),b=ur(),E=wl(h,"mermaid","diagram"),T=async k=>{try{if(k==="mmd"){let U=`${E}.mmd`;Un(U,e,"text/plain"),l(!1),n==null||n(k);return}if(!p){i==null||i(new Error("Mermaid plugin not available"));return}let C=p.getMermaid(a),w=e.split("").reduce((U,q)=>(U<<5)-U+q.charCodeAt(0)|0,0),H=`mermaid-${Math.abs(w)}-${Date.now()}-${Math.random().toString(36).substring(2,9)}`,{svg:z}=await C.render(H,e);if(!z){i==null||i(new Error("SVG not found. Please wait for the diagram to render."));return}let O=WA(z);if(k==="svg"){let U=`${E}.svg`;Un(U,O,"image/svg+xml"),l(!1),n==null||n(k);return}if(k==="png"){let U=await XA(O);Un(`${E}.png`,U,"image/png"),n==null||n(k),l(!1);return}}catch(C){i==null||i(C)}};return D.useEffect(()=>{let k=C=>{let w=C.composedPath();o.current&&!w.includes(o.current)&&l(!1)};return document.addEventListener("mousedown",k),()=>{document.removeEventListener("mousedown",k)}},[]),I.jsxs("div",{className:s("relative"),ref:o,children:[I.jsx("button",{"aria-label":b.downloadDiagram,className:s("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",r),disabled:c,onClick:()=>l(!u),title:b.downloadDiagram,type:"button",children:t??I.jsx(f.DownloadIcon,{"aria-hidden":"true",size:14})}),u?I.jsxs("div",{className:s("absolute top-full right-0 z-10 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg"),children:[I.jsx("button",{"aria-label":b.downloadDiagramAsSvg,className:s("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>T("svg"),title:b.downloadDiagramAsSvg,type:"button",children:b.mermaidFormatSvg}),I.jsx("button",{"aria-label":b.downloadDiagramAsPng,className:s("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>T("png"),title:b.downloadDiagramAsPng,type:"button",children:b.mermaidFormatPng}),I.jsx("button",{"aria-label":b.downloadDiagramAsMmd,className:s("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>T("mmd"),title:b.downloadDiagramAsMmd,type:"button",children:b.mermaidFormatMmd})]}):null]})},QA=({chart:e,config:t,onFullscreen:r,onExit:n,className:a,...i})=>{let{Maximize2Icon:s,XIcon:u}=Qt(),l=ve(),[o,c]=D.useState(!1),{isAnimating:h,controls:f,portal:p}=D.useContext(ut),b=ur(),E=(()=>{if(typeof f=="boolean")return f;let w=f.mermaid;return w===!1?!1:w===!0||w===void 0?!0:w.panZoom!==!1})(),T=(()=>{if(typeof f=="boolean")return f;let w=f.mermaid;return w===!1?!1:w===!0||w===void 0?!0:w.download!==!1})(),k=(()=>{if(typeof f=="boolean")return f;let w=f.mermaid;return w===!1?!1:w===!0||w===void 0?!0:w.copy!==!1})(),C=()=>{c(!o)};return D.useEffect(()=>{if(o){Cl();let w=H=>{H.key==="Escape"&&c(!1)};return document.addEventListener("keydown",w),()=>{document.removeEventListener("keydown",w),Sl()}}},[o]),D.useEffect(()=>{o?r==null||r():n&&n()},[o,r,n]),I.jsxs(I.Fragment,{children:[I.jsx("button",{className:l("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",a),disabled:h,onClick:C,title:b.viewFullscreen,type:"button",...i,"aria-label":b.viewFullscreen,children:I.jsx(s,{"aria-hidden":"true",size:14})}),o?Tu.createPortal(I.jsxs("div",{"aria-label":b.viewFullscreen,"aria-modal":"true",className:l("fixed inset-0 z-50 flex items-center justify-center bg-background/95 backdrop-blur-sm"),"data-streamdown":"mermaid-fullscreen",onClick:C,onKeyDown:w=>{w.key==="Escape"&&C()},role:"dialog",children:[I.jsxs("div",{className:l("absolute top-4 right-4 z-10 flex items-center gap-1"),onClick:w=>w.stopPropagation(),onKeyDown:w=>w.stopPropagation(),role:"presentation",children:[T?I.jsx(ep,{chart:e,config:t}):null,k?I.jsx(bu,{code:e}):null,I.jsx("button",{"aria-label":b.exitFullscreen,className:l("rounded-md p-2 text-muted-foreground transition-all hover:bg-muted hover:text-foreground"),onClick:C,title:b.exitFullscreen,type:"button",children:I.jsx(u,{"aria-hidden":"true",size:20})})]}),I.jsx("div",{className:l("flex size-full items-center justify-center p-4"),onClick:w=>w.stopPropagation(),onKeyDown:w=>w.stopPropagation(),role:"presentation",children:I.jsx(Up,{chart:e,className:l("size-full [&_svg]:h-auto [&_svg]:w-auto"),config:t,fullscreen:!0,showControls:E})})]}),Al(p)):null]})};function Eu(e){var t;if(e.nodeType===Node.TEXT_NODE)return(t=e.textContent)!=null?t:"";if(e.nodeType!==Node.ELEMENT_NODE)return"";let r=e;return r.tagName==="BR"?`
|
|
528
528
|
`:Array.from(r.childNodes).map(Eu).join("")}var tp=e=>{let t=[],r=[],n=e.querySelectorAll("thead th");for(let i of n)t.push(Eu(i).trim());let a=e.querySelectorAll("tbody tr");for(let i of a){let s=[],u=i.querySelectorAll("td");for(let l of u)s.push(Eu(l).trim());r.push(s)}return{headers:t,rows:r}},rp=e=>{var t;if(typeof e!="object")return",";let r=e.table;return typeof r!="object"?",":(t=r.csvSeparator)!=null?t:","},np=(e,t=",")=>{let r;t==="auto"?Intl.NumberFormat().format(1.1).includes(",")?r=";":r=",":r=t;let{headers:n,rows:a}=e,i=o=>{let c=!1;for(let h of o)if(h===r||h==='"'||h===`
|
|
529
529
|
`||h==="\r"){c=!0;break}return c?`"${o.replace(/"/g,'""')}"`:o},s=n.length>0?a.length+1:a.length,u=new Array(s),l=0;n.length>0&&(u[l]=n.map(i).join(r),l+=1);for(let o of a)u[l]=o.map(i).join(r),l+=1;return u.join(`
|
|
530
530
|
`)},KA=e=>{let{headers:t,rows:r}=e,n=u=>{let l=!1;for(let c of u)if(c===" "||c===`
|
|
@@ -559,4 +559,4 @@ ${f}`,a=e.length;break}if(!o.startsWith(`
|
|
|
559
559
|
<!---->
|
|
560
560
|
`);n+=`${s}
|
|
561
561
|
|
|
562
|
-
${h}`,a=e.length;break}return a===0?e:n+e.slice(a)},jC=(e,t)=>{if(!t.length)return e;let r=e;for(let n of t){let a=new RegExp(`(<${n}(?=[\\s>/])[^>]*>)([\\s\\S]*?)(</${n}\\s*>)`,"gi");r=r.replace(a,(i,s,u,l)=>UC(s,u,l)),r=qC(r,n)}return r},GC=/([\\`*_~[\]|])/g,VC=e=>e.replace(GC,"\\$1"),YC=(e,t)=>{if(!t.length)return e;let r=e;for(let n of t){let a=new RegExp(`(<${n}(?=[\\s>/])[^>]*>)([\\s\\S]*?)(</${n}\\s*>)`,"gi");r=r.replace(a,(i,s,u,l)=>{let o=VC(u).replace(/\n\n/g," ");return s+o+l})}return r},WC=new Set(["blockquote","dd","dt","figcaption","h1","h2","h3","h4","h5","h6","li","p","td","th"]),Mp=new Set(["code","kbd","pre","samp","var"]);function Pp(e){return e.children.map(t=>t.type==="text"?t.value:t.type==="element"&&!Mp.has(t.tagName)?Pp(t):"").join("")}function XC(){return e=>{Ht(e,"element",t=>{if(Mp.has(t.tagName)){t.properties!=null||(t.properties={}),t.properties.dir="ltr";return}WC.has(t.tagName)&&(t.properties!=null||(t.properties={}),typeof t.properties.dir!="string"&&(t.properties.dir=Np(Pp(t))))})}}var Bp=e=>e.type==="text"?e.value:"children"in e&&Array.isArray(e.children)?e.children.map(Bp).join(""):"",QC=e=>t=>{if(!e||e.length===0)return;let r=new Set(e.map(n=>n.toLowerCase()));Ht(t,"element",n=>{if(r.has(n.tagName.toLowerCase())){let a=Bp(n);n.children=a?[{type:"text",value:a}]:[]}})},KC=()=>e=>{Ht(e,"code",t=>{var r,n;t.meta&&(t.data=(r=t.data)!=null?r:{},t.data.hProperties={...(n=t.data.hProperties)!=null?n:{},metastring:t.meta})})},ZC=/^([a-zA-Z][a-zA-Z\d+\-.]*:)/,JC=e=>new Set(e.map(t=>t.trim().toLowerCase()).filter(t=>t.length>0).map(t=>t.endsWith(":")?t:`${t}:`));function eS(e,t,r){var n,a;let i=(a=(n=e.position)==null?void 0:n.start)==null?void 0:a.offset;if(typeof i=="number"&&r.charCodeAt(i)===91||e.children.length!==1)return!1;let[s]=e.children;if(s.type!=="text")return!1;let u=ZC.exec(e.url);if(!u)return!1;let l=u[1].toLowerCase();return t.has(l)?l==="mailto:"?e.url===`mailto:${s.value}`:e.url===s.value||e.url===`${l}//${s.value}`:!1}var tS=(e=[])=>{let t=JC(e);return(r,n)=>{var a;if(t.size===0)return;let i=String((a=n.value)!=null?a:"");Ht(r,"link",(s,u,l)=>{if(!(!l||u===void 0)&&eS(s,t,i))return l.children.splice(u,1,...s.children),u})}},q1="data-sd-caret-hidden",rS=e=>{let t=D.useRef(null),r=D.useRef(null),[n,a]=D.useState(!1);return D.useEffect(()=>a(!0),[]),D.useLayoutEffect(()=>{var i,s;let u=e&&(s=(i=t.current)==null?void 0:i.lastElementChild)!=null?s:null,l=r.current;l!==u&&(l==null||l.removeAttribute(q1),u==null||u.setAttribute(q1,""),r.current=u)}),{containerRef:t,showCaret:n||!e}},j1=/^[a-z]/,nS=/^[ \t]*<[\w!/?-]/,aS=/(^|\n)[ \t]{4,}(?=<[\w!/?-])/g,iS=e=>typeof e!="string"||e.length===0||!nS.test(e)?e:e.replace(aS,"$1"),G1,V1,Y1,W1,X1,Q1,Oi={...Pr,clobberPrefix:"",protocols:{...Pr.protocols,href:[...(V1=(G1=Pr.protocols)==null?void 0:G1.href)!=null?V1:[],"tel","streamdown"],src:[...(W1=(Y1=Pr.protocols)==null?void 0:Y1.src)!=null?W1:[],"streamdown"]},attributes:{...Pr.attributes,code:[...(Q1=(X1=Pr.attributes)==null?void 0:X1.code)!=null?Q1:[],"metastring"]}},Xn={raw:au,sanitize:[_f,Oi],harden:[K5,{allowedImagePrefixes:["*"],allowedLinkPrefixes:["*"],allowedProtocols:["*"],defaultOrigin:void 0,allowDataImages:!0}]},sS={gfm:[WE,{}],codeMeta:KC},K1=Object.values(Xn),uS=Object.values(sS),lS={block:" ▋",circle:" ●"},Fp=["github-light","github-dark"],Hp={enabled:!0},oS={codeBlockMaxHeight:400,shikiTheme:Fp,controls:!0,isAnimating:!1,lineNumbers:!0,mode:"streaming",mermaid:void 0,linkSafety:Hp,portal:void 0,tableMaxHeight:300},ut=D.createContext(oS),zp=D.memo(({content:e,shouldParseIncompleteMarkdown:t,shouldNormalizeHtmlIndentation:r,index:n,isIncomplete:a,dir:i,animatePlugin:s,...u})=>{D.useLayoutEffect(()=>{s==null||s.commit()});let l=typeof e=="string"&&r?iS(e):e,o=I.jsx(Lp,{...u,children:l});return I.jsx(jm.Provider,{value:a,children:i?I.jsx("div",{dir:i,style:{display:"contents"},children:o}):o})},(e,t)=>{if(e.content!==t.content||e.shouldNormalizeHtmlIndentation!==t.shouldNormalizeHtmlIndentation||e.index!==t.index||e.isIncomplete!==t.isIncomplete||e.dir!==t.dir)return!1;if(e.components!==t.components){let r=Object.keys(e.components||{}),n=Object.keys(t.components||{});if(r.length!==n.length||r.some(a=>{var i,s;return((i=e.components)==null?void 0:i[a])!==((s=t.components)==null?void 0:s[a])}))return!1}return!(e.rehypePlugins!==t.rehypePlugins||e.remarkPlugins!==t.remarkPlugins||!!e.animatePlugin!=!!t.animatePlugin)});zp.displayName="Block";var $p=D.memo(({children:e,mode:t="streaming",dir:r,parseIncompleteMarkdown:n=!0,normalizeHtmlIndentation:a=!1,components:i,rehypePlugins:s=K1,remarkPlugins:u=uS,className:l,shikiTheme:o,mermaid:c,codeBlockMaxHeight:h=400,controls:f=!0,isAnimating:p=!1,tableMaxHeight:b=300,animated:E,BlockComponent:T=zp,parseMarkdownIntoBlocksFn:k=HC,caret:C,plugins:w,remend:H,linkSafety:z=Hp,portal:O,lineNumbers:U=!0,allowedTags:q,fallbackComponent:G,literalTagContent:P,disableAutolinkProtocols:K,translations:j,icons:ce,prefix:re,onAnimationStart:Y,onAnimationEnd:le,...xe})=>{let _e=D.useId(),qe=D.useMemo(()=>fA(re),[re]),L=D.useRef(null),Ie=D.useRef(Y),Ge=D.useRef(le);Ie.current=Y,Ge.current=le,D.useEffect(()=>{var he,F,X;if(t==="static")return;let ie=L.current;if(L.current=p,ie===null){p&&((he=Ie.current)==null||he.call(Ie));return}p&&!ie?(F=Ie.current)==null||F.call(Ie):!p&&ie&&((X=Ge.current)==null||X.call(Ge))},[p,t]);let R=D.useMemo(()=>q?Object.keys(q):[],[q]),Pe=D.useMemo(()=>{if(typeof e!="string")return"";let he=t==="streaming"&&n?OT(e,H):e;return P&&P.length>0&&(he=YC(he,P)),R.length>0&&(he=jC(he,R)),he},[e,t,n,H,R,P]),ze=D.useMemo(()=>k(Pe),[Pe,k]),De=D.useMemo(()=>r==="auto"?ze.map(Np):void 0,[ze,r]),We=D.useMemo(()=>ze.map((he,F)=>`${_e}-${F}`),[ze.length,_e]),Xe=D.useMemo(()=>E===!0?"true":E?JSON.stringify(E):"",[E]),se=D.useRef(null),we=D.useRef([]),Qe=D.useRef([]),$t=D.useRef(null),Lt=D.useRef("");if(Xe){if(Lt.current!==Xe){Lt.current=Xe;let he=Xe!=="true"?E.maxBacklogMs:void 0;se.current=A1({maxBacklogMs:he}),we.current=[],Qe.current=[]}else se.current||(se.current=A1());p&&se.current&&se.current.beginPass(se.current.now())}else se.current=null,we.current=[],Qe.current=[],Lt.current="";D.useLayoutEffect(()=>{var he;p&&((he=se.current)==null||he.commitPass())});let lr=D.useMemo(()=>{var he,F;return{codeBlockMaxHeight:h,shikiTheme:(F=o??((he=w==null?void 0:w.code)==null?void 0:he.getThemes()))!=null?F:Fp,controls:f,isAnimating:p,lineNumbers:U,mode:t,mermaid:c,linkSafety:z,portal:O,tableMaxHeight:b}},[h,o,f,p,U,t,c,z,O,w==null?void 0:w.code,b]),Sn=D.useMemo(()=>j?JSON.stringify(j):"",[j]),Jr=D.useMemo(()=>({...Km,...j}),[Sn]),en=D.useMemo(()=>{let{inlineCode:he,...F}=i??{},X={...cC,...F};if(he){let ie=X.code;X.code=oe=>"data-block"in oe?ie?D.createElement(ie,oe):null:D.createElement(he,oe)}if(G){if(q)for(let oe of Object.keys(q))Object.hasOwn(X,oe)||(X[oe]=G);let ie={configurable:!0,enumerable:!1,value:G,writable:!1};return new Proxy(X,{getOwnPropertyDescriptor(oe,Ee){let nt=Object.getOwnPropertyDescriptor(oe,Ee);if(nt)return nt;if(typeof Ee=="string"&&j1.test(Ee))return ie},get(oe,Ee,nt){return typeof Ee=="string"&&j1.test(Ee)&&!Object.hasOwn(oe,Ee)?G:Reflect.get(oe,Ee,nt)}})}return X},[i,G,q]),tn=D.useMemo(()=>{let he=[];return w!=null&&w.cjk&&(he=[...he,...w.cjk.remarkPluginsBefore]),he=[...he,...u],K&&K.length>0&&(he=[...he,[tS,K]]),w!=null&&w.cjk&&(he=[...he,...w.cjk.remarkPluginsAfter]),w!=null&&w.math&&(he=[...he,w.math.remarkPlugin]),he},[u,w==null?void 0:w.math,w==null?void 0:w.cjk,K]),Ut=D.useMemo(()=>{var he;let F=s;if(q&&Object.keys(q).length>0&&s===K1){let X={...Oi,tagNames:[...(he=Oi.tagNames)!=null?he:[],...Object.keys(q)],attributes:{...Oi.attributes,...q}};F=[Xn.raw,[_f,X],Xn.harden]}return P&&P.length>0&&(F=[...F,[QC,P]]),w!=null&&w.math&&(F=[...F,w.math.rehypePlugin]),r==="auto"&&t==="static"&&(F=[...F,XC]),F},[s,w==null?void 0:w.math,q,P,r,t]),or=D.useMemo(()=>C&&p?{"--streamdown-caret":`"${lS[C]}"`}:void 0,[C,p]),la=D.useMemo(()=>{if(!p||ze.length===0)return!1;let he=ze.at(-1);return M1(he)||pC(he)},[p,ze]),{containerRef:oa,showCaret:rn}=rS(la),In=he=>{let F=null;if(se.current&&p){if(!we.current[he]){let ie=Xe&&Xe!=="true"?E:{},{maxBacklogMs:oe,...Ee}=ie;we.current[he]=hA({...Ee,timeline:se.current})}F=we.current[he]}$t.current!==Ut&&(Qe.current=[],$t.current=Ut),F&&!Qe.current[he]&&(Qe.current[he]=[...Ut,F.rehypePlugin]);let X=F&&Qe.current[he]?Qe.current[he]:Ut;return{blockAnimatePlugin:F,blockRehypePlugins:X}};return t==="static"?I.jsx(gu.Provider,{value:Jr,children:I.jsx(xu.Provider,{value:w??null,children:I.jsx(ut.Provider,{value:lr,children:I.jsx(I1,{icons:ce,children:I.jsx(pu.Provider,{value:qe,children:I.jsx("div",{className:qe("space-y-4 whitespace-normal [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",l),dir:r==="auto"?void 0:r,children:I.jsx(Lp,{components:en,rehypePlugins:Ut,remarkPlugins:tn,...xe,children:Pe})})})})})})}):I.jsx(gu.Provider,{value:Jr,children:I.jsx(xu.Provider,{value:w??null,children:I.jsx(ut.Provider,{value:lr,children:I.jsx(I1,{icons:ce,children:I.jsx(pu.Provider,{value:qe,children:I.jsxs("div",{className:qe("space-y-4 whitespace-normal [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",C&&rn?"[&>*:last-child:not([data-sd-caret-hidden])]:after:inline [&>*:last-child:not([data-sd-caret-hidden])]:after:align-baseline [&>*:last-child:not([data-sd-caret-hidden])]:after:content-[var(--streamdown-caret)]":null,l),ref:oa,style:or,children:[ze.length===0&&C&&p&&I.jsx("span",{}),ze.map((he,F)=>{var X;let ie=F===ze.length-1,oe=p&&ie&&M1(he),{blockAnimatePlugin:Ee,blockRehypePlugins:nt}=In(F);return I.jsx(T,{animatePlugin:Ee,components:en,content:he,dir:(X=De==null?void 0:De[F])!=null?X:r!=="auto"?r:void 0,index:F,isIncomplete:oe,rehypePlugins:nt,remarkPlugins:tn,shouldNormalizeHtmlIndentation:a,shouldParseIncompleteMarkdown:n,...xe},We[F])})]})})})})})})},(e,t)=>e.children===t.children&&e.shikiTheme===t.shikiTheme&&e.isAnimating===t.isAnimating&&e.animated===t.animated&&e.mode===t.mode&&e.plugins===t.plugins&&e.className===t.className&&e.linkSafety===t.linkSafety&&e.lineNumbers===t.lineNumbers&&e.codeBlockMaxHeight===t.codeBlockMaxHeight&&e.tableMaxHeight===t.tableMaxHeight&&e.normalizeHtmlIndentation===t.normalizeHtmlIndentation&&e.literalTagContent===t.literalTagContent&&e.disableAutolinkProtocols===t.disableAutolinkProtocols&&JSON.stringify(e.translations)===JSON.stringify(t.translations)&&e.prefix===t.prefix&&e.dir===t.dir&&e.fallbackComponent===t.fallbackComponent);$p.displayName="Streamdown";var Ea=e=>e>0?e:null,cS=(e,t)=>{if(e.endsWith("px"))return Ea(Number.parseFloat(e));if(e.endsWith("rem")){let r=Number.parseFloat(getComputedStyle(document.documentElement).fontSize||"16");return Ea(Number.parseFloat(e)*r)}if(e.endsWith("em")){let r=Number.parseFloat(getComputedStyle(t).fontSize||"16");return Ea(Number.parseFloat(e)*r)}if(e.endsWith("vh"))return Ea(Number.parseFloat(e)/100*window.innerHeight);if(e.endsWith("%")){let r=t.parentElement;return r&&r.clientHeight>0?Ea(Number.parseFloat(e)/100*r.clientHeight):null}return null},v0=(e,t)=>{let r=t.trim().toLowerCase();return!r||r==="none"||r==="auto"?null:cS(r,e)},hS=/^min\(\s*([^,]+)\s*,\s*([^)]+)\s*\)$/i,dS=(e,t)=>{let r=v0(e,t);if(r!=null)return r;let n=t.trim().match(hS);if(!n)return null;let a=v0(e,n[1].trim()),i=v0(e,n[2].trim());return a==null||i==null?null:Math.min(a,i)},fS=(e,t,r)=>{let n=t.clientWidth;if(!(n>0))return null;if(r){let c=t.clientHeight;if(!(c>0))return null;let h=Math.min(n/e.width,c/e.height,1);return!(h>0)||Number.isNaN(h)?null:{fitZoom:h,viewportHeight:null}}let a=Math.min(n/e.width,1);if(!(a>0)||Number.isNaN(a))return null;let i=e.height*a,s=null,u=t;for(;u&&s==null;){let c=getComputedStyle(u);s=dS(u,c.maxHeight),u=u.parentElement}let l=s!=null?Math.min(i,s):i,o=Math.min(a,l/e.height,1);return!(o>0)||Number.isNaN(o)?null:{fitZoom:o,viewportHeight:l}},mS=({children:e,className:t,contentSize:r,fitKey:n,minZoom:a=.5,maxZoom:i=3,zoomStep:s=.1,showControls:u=!0,initialZoom:l=1,isAutoFit:o=!1,fullscreen:c=!1})=>{let{RotateCcwIcon:h,ZoomInIcon:f,ZoomOutIcon:p}=Qt(),b=ve(),E=ur(),T=D.useRef(null),k=D.useRef(null),C=D.useRef(!1),[w,H]=D.useState(l),[z,O]=D.useState(a),[U,q]=D.useState(l),[G,P]=D.useState({x:0,y:0}),[K,j]=D.useState(!1),[ce,re]=D.useState({x:0,y:0}),[Y,le]=D.useState({x:0,y:0}),[xe,_e]=D.useState(null),qe=D.useCallback(se=>{let we=T.current;if(!we)return;let Qe=fS(se,we,c);if(!Qe)return;let{fitZoom:$t,viewportHeight:Lt}=Qe;_e(Lt),H($t),O(Math.min(a,$t)),C.current||(q($t),P({x:0,y:0}))},[c,a]),L=D.useCallback(se=>{q(we=>Math.max(z,Math.min(i,we+se))),C.current=!0},[z,i]),Ie=D.useCallback(()=>{L(s)},[L,s]),Ge=D.useCallback(()=>{L(-s)},[L,s]),R=D.useCallback(()=>{q(w),P({x:0,y:0}),C.current=!1},[w]),Pe=D.useCallback(se=>{se.preventDefault();let we=se.deltaY>0?-s:s;L(we)},[L,s]),ze=D.useCallback(se=>{if(se.button!==0||se.isPrimary===!1)return;j(!0),C.current=!0,re({x:se.clientX,y:se.clientY}),le(G);let we=se.currentTarget;we instanceof HTMLElement&&we.setPointerCapture(se.pointerId)},[G]),De=D.useCallback(se=>{if(!K)return;se.preventDefault();let we=se.clientX-ce.x,Qe=se.clientY-ce.y;P({x:Y.x+we,y:Y.y+Qe})},[K,ce,Y]),We=D.useCallback(se=>{j(!1);let we=se.currentTarget;we instanceof HTMLElement&&we.releasePointerCapture(se.pointerId)},[]);D.useEffect(()=>{O(a),o||(H(l),q(l),_e(null))},[l,o,a]),D.useLayoutEffect(()=>{if(!(o&&r))return;qe(r);let se=T.current;if(!se||typeof ResizeObserver>"u")return;let we=new ResizeObserver(()=>{qe(r)});return we.observe(se),()=>{we.disconnect()}},[qe,r,o]),D.useEffect(()=>{o&&(C.current=!1)},[n,o]),D.useEffect(()=>{let se=T.current;if(se)return se.addEventListener("wheel",Pe,{passive:!1}),()=>{se.removeEventListener("wheel",Pe)}},[Pe]),D.useEffect(()=>{let se=k.current;if(se&&K)return document.body.style.userSelect="none",se.addEventListener("pointermove",De,{passive:!1}),se.addEventListener("pointerup",We),se.addEventListener("pointercancel",We),()=>{document.body.style.userSelect="",se.removeEventListener("pointermove",De),se.removeEventListener("pointerup",We),se.removeEventListener("pointercancel",We)}},[K,De,We]);let Xe=!c&&o&&xe!=null?{height:xe}:void 0;return I.jsxs("div",{className:b("relative flex flex-col",c?"h-full w-full":"min-h-28 w-full",t),ref:T,style:{cursor:K?"grabbing":"grab",...Xe},children:[u?I.jsxs("div",{className:b("absolute z-10 flex flex-col gap-1 rounded-md border border-border bg-background/80 p-1 supports-[backdrop-filter]:bg-background/70 supports-[backdrop-filter]:backdrop-blur-sm",c?"bottom-4 left-4":"bottom-2 left-2"),children:[I.jsx("button",{"aria-label":E.zoomIn,className:b("flex items-center justify-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50"),disabled:U>=i,onClick:Ie,title:E.zoomIn,type:"button",children:I.jsx(f,{"aria-hidden":"true",size:16})}),I.jsx("button",{"aria-label":E.zoomOut,className:b("flex items-center justify-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50"),disabled:U<=z,onClick:Ge,title:E.zoomOut,type:"button",children:I.jsx(p,{"aria-hidden":"true",size:16})}),I.jsx("button",{"aria-label":E.resetView,className:b("flex items-center justify-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground"),onClick:R,title:E.resetView,type:"button",children:I.jsx(h,{"aria-hidden":"true",size:16})})]}):null,I.jsx("div",{className:b("flex h-full w-full flex-1 origin-center items-center justify-center transition-transform duration-150 ease-out"),onPointerDown:ze,ref:k,role:"application",style:{transform:`translate(${G.x}px, ${G.y}px) scale(${U})`,transformOrigin:"center center",touchAction:"none",willChange:"transform"},children:e})]})},pS=(e,t)=>new Promise(r=>{let n=setTimeout(r,e);t(()=>{clearTimeout(n),r()})}),gS=async(e,{chart:t,config:r},n)=>{try{let a=e.getMermaid(r),i=t.split("").reduce((o,c)=>(o<<5)-o+c.charCodeAt(0)|0,0),s=`mermaid-${Math.abs(i)}-${Date.now()}-${Math.random().toString(36).substring(2,9)}`,{svg:u}=await a.render(s,t),l=Jm(u);return{ok:!0,svg:n?u:YA(u),size:l}}catch(a){return{ok:!1,error:a instanceof Error?a.message:"Failed to render Mermaid chart"}}},Up=({chart:e,className:t,config:r,fullscreen:n=!1,showControls:a=!0})=>{let i=ve(),[s,u]=D.useState(null),[l,o]=D.useState(!1),[c,h]=D.useState(""),[f,p]=D.useState(null),[b,E]=D.useState(""),[T,k]=D.useState(0),{mermaid:C}=D.useContext(ut),w=_l(),H=C==null?void 0:C.errorComponent,{shouldRender:z,containerRef:O}=Xw({immediate:n}),U=D.useRef(null),q=D.useRef(!1),G=D.useRef(!1),P=Gm(),K=D.useRef(P),j=D.useRef(null);D.useEffect(()=>(G.current=!0,()=>{var Y;G.current=!1,(Y=j.current)==null||Y.call(j)}),[]),D.useEffect(()=>{var Y;K.current=P,P||(Y=j.current)==null||Y.call(j)},[P]);let ce=async Y=>{K.current&&(await pS(Y,le=>{j.current=le}),j.current=null)};if(D.useEffect(()=>{if(!z)return;if(!w){u("Mermaid plugin not available. Please add the mermaid plugin to enable diagram rendering.");return}if(U.current={chart:e,config:r},q.current)return;let Y=(le,xe)=>{xe.ok?(h(xe.svg),p(xe.size),E(xe.svg)):le===U.current&&u(xe.error)};(async()=>{q.current=!0,u(null),o(!0);try{let le=U.current;for(;le;){let xe=performance.now(),_e=await gS(w,le,n);if(!G.current||(Y(le,_e),_e.ok&&await ce(performance.now()-xe),!G.current||le===U.current))return;le=U.current}}finally{q.current=!1,G.current&&o(!1)}})()},[e,r,T,z,w]),!(z||c||b))return I.jsx("div",{className:i("my-4 min-h-[200px]",t),ref:O});if(l&&!c&&!b)return I.jsx("div",{className:i("my-4 flex justify-center p-4",t),ref:O,children:I.jsxs("div",{className:i("flex items-center space-x-2 text-muted-foreground"),children:[I.jsx("div",{className:i("h-4 w-4 animate-spin rounded-full border-current border-b-2")}),I.jsx("span",{className:i("text-sm"),children:"Loading diagram..."})]})});if(s&&!c&&!b){let Y=()=>k(le=>le+1);return H?I.jsx("div",{ref:O,children:I.jsx(H,{chart:e,error:s,retry:Y})}):I.jsxs("div",{className:i("rounded-md bg-red-50 p-4",t),ref:O,children:[I.jsxs("p",{className:i("font-mono text-red-700 text-sm"),children:["Mermaid Error: ",s]}),I.jsxs("details",{className:i("mt-2"),children:[I.jsx("summary",{className:i("cursor-pointer text-red-600 text-xs"),children:"Show Code"}),I.jsx("pre",{className:i("mt-2 overflow-x-auto rounded bg-red-100 p-2 text-red-800 text-xs"),children:e})]})]})}let re=c||b;return I.jsx("div",{className:i(n?"size-full":"max-h-[min(70vh,40rem)] w-full",t),"data-streamdown":"mermaid",ref:O,children:I.jsx(mS,{className:i(n?"size-full overflow-hidden":"max-h-[min(70vh,40rem)] overflow-hidden",t),contentSize:f,fitKey:e,fullscreen:n,isAutoFit:!0,maxZoom:3,minZoom:.1,showControls:a,zoomStep:.1,children:I.jsx("div",{"aria-label":"Mermaid chart",className:i("flex justify-center",n?"size-full items-center":null),dangerouslySetInnerHTML:{__html:re},role:"img"})})})};const bS={code:t3,math:Q5},[xS,ES]=Xn.harden,yS=[Xn.raw,Xn.sanitize,[xS,{...ES,allowedImagePrefixes:[],allowDataImages:!1}]];function TS(e){return I.jsx($p,{plugins:bS,rehypePlugins:yS,...e})}const RS=Object.freeze(Object.defineProperty({__proto__:null,default:TS},Symbol.toStringTag,{value:"Module"})),vS=Object.freeze(Object.defineProperty({__proto__:null,Mermaid:Up},Symbol.toStringTag,{value:"Module"}));export{LS as F,ut as S,xA as a,RS as m};
|
|
562
|
+
${h}`,a=e.length;break}return a===0?e:n+e.slice(a)},jC=(e,t)=>{if(!t.length)return e;let r=e;for(let n of t){let a=new RegExp(`(<${n}(?=[\\s>/])[^>]*>)([\\s\\S]*?)(</${n}\\s*>)`,"gi");r=r.replace(a,(i,s,u,l)=>UC(s,u,l)),r=qC(r,n)}return r},GC=/([\\`*_~[\]|])/g,VC=e=>e.replace(GC,"\\$1"),YC=(e,t)=>{if(!t.length)return e;let r=e;for(let n of t){let a=new RegExp(`(<${n}(?=[\\s>/])[^>]*>)([\\s\\S]*?)(</${n}\\s*>)`,"gi");r=r.replace(a,(i,s,u,l)=>{let o=VC(u).replace(/\n\n/g," ");return s+o+l})}return r},WC=new Set(["blockquote","dd","dt","figcaption","h1","h2","h3","h4","h5","h6","li","p","td","th"]),Mp=new Set(["code","kbd","pre","samp","var"]);function Pp(e){return e.children.map(t=>t.type==="text"?t.value:t.type==="element"&&!Mp.has(t.tagName)?Pp(t):"").join("")}function XC(){return e=>{Ht(e,"element",t=>{if(Mp.has(t.tagName)){t.properties!=null||(t.properties={}),t.properties.dir="ltr";return}WC.has(t.tagName)&&(t.properties!=null||(t.properties={}),typeof t.properties.dir!="string"&&(t.properties.dir=Np(Pp(t))))})}}var Bp=e=>e.type==="text"?e.value:"children"in e&&Array.isArray(e.children)?e.children.map(Bp).join(""):"",QC=e=>t=>{if(!e||e.length===0)return;let r=new Set(e.map(n=>n.toLowerCase()));Ht(t,"element",n=>{if(r.has(n.tagName.toLowerCase())){let a=Bp(n);n.children=a?[{type:"text",value:a}]:[]}})},KC=()=>e=>{Ht(e,"code",t=>{var r,n;t.meta&&(t.data=(r=t.data)!=null?r:{},t.data.hProperties={...(n=t.data.hProperties)!=null?n:{},metastring:t.meta})})},ZC=/^([a-zA-Z][a-zA-Z\d+\-.]*:)/,JC=e=>new Set(e.map(t=>t.trim().toLowerCase()).filter(t=>t.length>0).map(t=>t.endsWith(":")?t:`${t}:`));function eS(e,t,r){var n,a;let i=(a=(n=e.position)==null?void 0:n.start)==null?void 0:a.offset;if(typeof i=="number"&&r.charCodeAt(i)===91||e.children.length!==1)return!1;let[s]=e.children;if(s.type!=="text")return!1;let u=ZC.exec(e.url);if(!u)return!1;let l=u[1].toLowerCase();return t.has(l)?l==="mailto:"?e.url===`mailto:${s.value}`:e.url===s.value||e.url===`${l}//${s.value}`:!1}var tS=(e=[])=>{let t=JC(e);return(r,n)=>{var a;if(t.size===0)return;let i=String((a=n.value)!=null?a:"");Ht(r,"link",(s,u,l)=>{if(!(!l||u===void 0)&&eS(s,t,i))return l.children.splice(u,1,...s.children),u})}},q1="data-sd-caret-hidden",rS=e=>{let t=D.useRef(null),r=D.useRef(null),[n,a]=D.useState(!1);return D.useEffect(()=>a(!0),[]),D.useLayoutEffect(()=>{var i,s;let u=e&&(s=(i=t.current)==null?void 0:i.lastElementChild)!=null?s:null,l=r.current;l!==u&&(l==null||l.removeAttribute(q1),u==null||u.setAttribute(q1,""),r.current=u)}),{containerRef:t,showCaret:n||!e}},j1=/^[a-z]/,nS=/^[ \t]*<[\w!/?-]/,aS=/(^|\n)[ \t]{4,}(?=<[\w!/?-])/g,iS=e=>typeof e!="string"||e.length===0||!nS.test(e)?e:e.replace(aS,"$1"),G1,V1,Y1,W1,X1,Q1,Oi={...Pr,clobberPrefix:"",protocols:{...Pr.protocols,href:[...(V1=(G1=Pr.protocols)==null?void 0:G1.href)!=null?V1:[],"tel","streamdown"],src:[...(W1=(Y1=Pr.protocols)==null?void 0:Y1.src)!=null?W1:[],"streamdown"]},attributes:{...Pr.attributes,code:[...(Q1=(X1=Pr.attributes)==null?void 0:X1.code)!=null?Q1:[],"metastring"]}},Xn={raw:au,sanitize:[_f,Oi],harden:[K5,{allowedImagePrefixes:["*"],allowedLinkPrefixes:["*"],allowedProtocols:["*"],defaultOrigin:void 0,allowDataImages:!0}]},sS={gfm:[WE,{}],codeMeta:KC},K1=Object.values(Xn),uS=Object.values(sS),lS={block:" ▋",circle:" ●"},Fp=["github-light","github-dark"],Hp={enabled:!0},oS={codeBlockMaxHeight:400,shikiTheme:Fp,controls:!0,isAnimating:!1,lineNumbers:!0,mode:"streaming",mermaid:void 0,linkSafety:Hp,portal:void 0,tableMaxHeight:300},ut=D.createContext(oS),zp=D.memo(({content:e,shouldParseIncompleteMarkdown:t,shouldNormalizeHtmlIndentation:r,index:n,isIncomplete:a,dir:i,animatePlugin:s,...u})=>{D.useLayoutEffect(()=>{s==null||s.commit()});let l=typeof e=="string"&&r?iS(e):e,o=I.jsx(Lp,{...u,children:l});return I.jsx(jm.Provider,{value:a,children:i?I.jsx("div",{dir:i,style:{display:"contents"},children:o}):o})},(e,t)=>{if(e.content!==t.content||e.shouldNormalizeHtmlIndentation!==t.shouldNormalizeHtmlIndentation||e.index!==t.index||e.isIncomplete!==t.isIncomplete||e.dir!==t.dir)return!1;if(e.components!==t.components){let r=Object.keys(e.components||{}),n=Object.keys(t.components||{});if(r.length!==n.length||r.some(a=>{var i,s;return((i=e.components)==null?void 0:i[a])!==((s=t.components)==null?void 0:s[a])}))return!1}return!(e.rehypePlugins!==t.rehypePlugins||e.remarkPlugins!==t.remarkPlugins||!!e.animatePlugin!=!!t.animatePlugin)});zp.displayName="Block";var $p=D.memo(({children:e,mode:t="streaming",dir:r,parseIncompleteMarkdown:n=!0,normalizeHtmlIndentation:a=!1,components:i,rehypePlugins:s=K1,remarkPlugins:u=uS,className:l,shikiTheme:o,mermaid:c,codeBlockMaxHeight:h=400,controls:f=!0,isAnimating:p=!1,tableMaxHeight:b=300,animated:E,BlockComponent:T=zp,parseMarkdownIntoBlocksFn:k=HC,caret:C,plugins:w,remend:H,linkSafety:z=Hp,portal:O,lineNumbers:U=!0,allowedTags:q,fallbackComponent:G,literalTagContent:P,disableAutolinkProtocols:K,translations:j,icons:ce,prefix:re,onAnimationStart:Y,onAnimationEnd:le,...xe})=>{let _e=D.useId(),qe=D.useMemo(()=>fA(re),[re]),L=D.useRef(null),Ie=D.useRef(Y),Ge=D.useRef(le);Ie.current=Y,Ge.current=le,D.useEffect(()=>{var he,F,X;if(t==="static")return;let ie=L.current;if(L.current=p,ie===null){p&&((he=Ie.current)==null||he.call(Ie));return}p&&!ie?(F=Ie.current)==null||F.call(Ie):!p&&ie&&((X=Ge.current)==null||X.call(Ge))},[p,t]);let R=D.useMemo(()=>q?Object.keys(q):[],[q]),Pe=D.useMemo(()=>{if(typeof e!="string")return"";let he=t==="streaming"&&n?OT(e,H):e;return P&&P.length>0&&(he=YC(he,P)),R.length>0&&(he=jC(he,R)),he},[e,t,n,H,R,P]),ze=D.useMemo(()=>k(Pe),[Pe,k]),De=D.useMemo(()=>r==="auto"?ze.map(Np):void 0,[ze,r]),We=D.useMemo(()=>ze.map((he,F)=>`${_e}-${F}`),[ze.length,_e]),Xe=D.useMemo(()=>E===!0?"true":E?JSON.stringify(E):"",[E]),se=D.useRef(null),we=D.useRef([]),Qe=D.useRef([]),$t=D.useRef(null),Lt=D.useRef("");if(Xe){if(Lt.current!==Xe){Lt.current=Xe;let he=Xe!=="true"?E.maxBacklogMs:void 0;se.current=A1({maxBacklogMs:he}),we.current=[],Qe.current=[]}else se.current||(se.current=A1());p&&se.current&&se.current.beginPass(se.current.now())}else se.current=null,we.current=[],Qe.current=[],Lt.current="";D.useLayoutEffect(()=>{var he;p&&((he=se.current)==null||he.commitPass())});let lr=D.useMemo(()=>{var he,F;return{codeBlockMaxHeight:h,shikiTheme:(F=o??((he=w==null?void 0:w.code)==null?void 0:he.getThemes()))!=null?F:Fp,controls:f,isAnimating:p,lineNumbers:U,mode:t,mermaid:c,linkSafety:z,portal:O,tableMaxHeight:b}},[h,o,f,p,U,t,c,z,O,w==null?void 0:w.code,b]),Sn=D.useMemo(()=>j?JSON.stringify(j):"",[j]),Jr=D.useMemo(()=>({...Km,...j}),[Sn]),en=D.useMemo(()=>{let{inlineCode:he,...F}=i??{},X={...cC,...F};if(he){let ie=X.code;X.code=oe=>"data-block"in oe?ie?D.createElement(ie,oe):null:D.createElement(he,oe)}if(G){if(q)for(let oe of Object.keys(q))Object.hasOwn(X,oe)||(X[oe]=G);let ie={configurable:!0,enumerable:!1,value:G,writable:!1};return new Proxy(X,{getOwnPropertyDescriptor(oe,Ee){let nt=Object.getOwnPropertyDescriptor(oe,Ee);if(nt)return nt;if(typeof Ee=="string"&&j1.test(Ee))return ie},get(oe,Ee,nt){return typeof Ee=="string"&&j1.test(Ee)&&!Object.hasOwn(oe,Ee)?G:Reflect.get(oe,Ee,nt)}})}return X},[i,G,q]),tn=D.useMemo(()=>{let he=[];return w!=null&&w.cjk&&(he=[...he,...w.cjk.remarkPluginsBefore]),he=[...he,...u],K&&K.length>0&&(he=[...he,[tS,K]]),w!=null&&w.cjk&&(he=[...he,...w.cjk.remarkPluginsAfter]),w!=null&&w.math&&(he=[...he,w.math.remarkPlugin]),he},[u,w==null?void 0:w.math,w==null?void 0:w.cjk,K]),Ut=D.useMemo(()=>{var he;let F=s;if(q&&Object.keys(q).length>0&&s===K1){let X={...Oi,tagNames:[...(he=Oi.tagNames)!=null?he:[],...Object.keys(q)],attributes:{...Oi.attributes,...q}};F=[Xn.raw,[_f,X],Xn.harden]}return P&&P.length>0&&(F=[...F,[QC,P]]),w!=null&&w.math&&(F=[...F,w.math.rehypePlugin]),r==="auto"&&t==="static"&&(F=[...F,XC]),F},[s,w==null?void 0:w.math,q,P,r,t]),or=D.useMemo(()=>C&&p?{"--streamdown-caret":`"${lS[C]}"`}:void 0,[C,p]),la=D.useMemo(()=>{if(!p||ze.length===0)return!1;let he=ze.at(-1);return M1(he)||pC(he)},[p,ze]),{containerRef:oa,showCaret:rn}=rS(la),In=he=>{let F=null;if(se.current&&p){if(!we.current[he]){let ie=Xe&&Xe!=="true"?E:{},{maxBacklogMs:oe,...Ee}=ie;we.current[he]=hA({...Ee,timeline:se.current})}F=we.current[he]}$t.current!==Ut&&(Qe.current=[],$t.current=Ut),F&&!Qe.current[he]&&(Qe.current[he]=[...Ut,F.rehypePlugin]);let X=F&&Qe.current[he]?Qe.current[he]:Ut;return{blockAnimatePlugin:F,blockRehypePlugins:X}};return t==="static"?I.jsx(gu.Provider,{value:Jr,children:I.jsx(xu.Provider,{value:w??null,children:I.jsx(ut.Provider,{value:lr,children:I.jsx(I1,{icons:ce,children:I.jsx(pu.Provider,{value:qe,children:I.jsx("div",{className:qe("space-y-4 whitespace-normal [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",l),dir:r==="auto"?void 0:r,children:I.jsx(Lp,{components:en,rehypePlugins:Ut,remarkPlugins:tn,...xe,children:Pe})})})})})})}):I.jsx(gu.Provider,{value:Jr,children:I.jsx(xu.Provider,{value:w??null,children:I.jsx(ut.Provider,{value:lr,children:I.jsx(I1,{icons:ce,children:I.jsx(pu.Provider,{value:qe,children:I.jsxs("div",{className:qe("space-y-4 whitespace-normal [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",C&&rn?"[&>*:last-child:not([data-sd-caret-hidden])]:after:inline [&>*:last-child:not([data-sd-caret-hidden])]:after:align-baseline [&>*:last-child:not([data-sd-caret-hidden])]:after:content-[var(--streamdown-caret)]":null,l),ref:oa,style:or,children:[ze.length===0&&C&&p&&I.jsx("span",{}),ze.map((he,F)=>{var X;let ie=F===ze.length-1,oe=p&&ie&&M1(he),{blockAnimatePlugin:Ee,blockRehypePlugins:nt}=In(F);return I.jsx(T,{animatePlugin:Ee,components:en,content:he,dir:(X=De==null?void 0:De[F])!=null?X:r!=="auto"?r:void 0,index:F,isIncomplete:oe,rehypePlugins:nt,remarkPlugins:tn,shouldNormalizeHtmlIndentation:a,shouldParseIncompleteMarkdown:n,...xe},We[F])})]})})})})})})},(e,t)=>e.children===t.children&&e.shikiTheme===t.shikiTheme&&e.isAnimating===t.isAnimating&&e.animated===t.animated&&e.mode===t.mode&&e.plugins===t.plugins&&e.className===t.className&&e.linkSafety===t.linkSafety&&e.lineNumbers===t.lineNumbers&&e.codeBlockMaxHeight===t.codeBlockMaxHeight&&e.tableMaxHeight===t.tableMaxHeight&&e.normalizeHtmlIndentation===t.normalizeHtmlIndentation&&e.literalTagContent===t.literalTagContent&&e.disableAutolinkProtocols===t.disableAutolinkProtocols&&JSON.stringify(e.translations)===JSON.stringify(t.translations)&&e.prefix===t.prefix&&e.dir===t.dir&&e.fallbackComponent===t.fallbackComponent);$p.displayName="Streamdown";var Ea=e=>e>0?e:null,cS=(e,t)=>{if(e.endsWith("px"))return Ea(Number.parseFloat(e));if(e.endsWith("rem")){let r=Number.parseFloat(getComputedStyle(document.documentElement).fontSize||"16");return Ea(Number.parseFloat(e)*r)}if(e.endsWith("em")){let r=Number.parseFloat(getComputedStyle(t).fontSize||"16");return Ea(Number.parseFloat(e)*r)}if(e.endsWith("vh"))return Ea(Number.parseFloat(e)/100*window.innerHeight);if(e.endsWith("%")){let r=t.parentElement;return r&&r.clientHeight>0?Ea(Number.parseFloat(e)/100*r.clientHeight):null}return null},v0=(e,t)=>{let r=t.trim().toLowerCase();return!r||r==="none"||r==="auto"?null:cS(r,e)},hS=/^min\(\s*([^,]+)\s*,\s*([^)]+)\s*\)$/i,dS=(e,t)=>{let r=v0(e,t);if(r!=null)return r;let n=t.trim().match(hS);if(!n)return null;let a=v0(e,n[1].trim()),i=v0(e,n[2].trim());return a==null||i==null?null:Math.min(a,i)},fS=(e,t,r)=>{let n=t.clientWidth;if(!(n>0))return null;if(r){let c=t.clientHeight;if(!(c>0))return null;let h=Math.min(n/e.width,c/e.height,1);return!(h>0)||Number.isNaN(h)?null:{fitZoom:h,viewportHeight:null}}let a=Math.min(n/e.width,1);if(!(a>0)||Number.isNaN(a))return null;let i=e.height*a,s=null,u=t;for(;u&&s==null;){let c=getComputedStyle(u);s=dS(u,c.maxHeight),u=u.parentElement}let l=s!=null?Math.min(i,s):i,o=Math.min(a,l/e.height,1);return!(o>0)||Number.isNaN(o)?null:{fitZoom:o,viewportHeight:l}},mS=({children:e,className:t,contentSize:r,fitKey:n,minZoom:a=.5,maxZoom:i=3,zoomStep:s=.1,showControls:u=!0,initialZoom:l=1,isAutoFit:o=!1,fullscreen:c=!1})=>{let{RotateCcwIcon:h,ZoomInIcon:f,ZoomOutIcon:p}=Qt(),b=ve(),E=ur(),T=D.useRef(null),k=D.useRef(null),C=D.useRef(!1),[w,H]=D.useState(l),[z,O]=D.useState(a),[U,q]=D.useState(l),[G,P]=D.useState({x:0,y:0}),[K,j]=D.useState(!1),[ce,re]=D.useState({x:0,y:0}),[Y,le]=D.useState({x:0,y:0}),[xe,_e]=D.useState(null),qe=D.useCallback(se=>{let we=T.current;if(!we)return;let Qe=fS(se,we,c);if(!Qe)return;let{fitZoom:$t,viewportHeight:Lt}=Qe;_e(Lt),H($t),O(Math.min(a,$t)),C.current||(q($t),P({x:0,y:0}))},[c,a]),L=D.useCallback(se=>{q(we=>Math.max(z,Math.min(i,we+se))),C.current=!0},[z,i]),Ie=D.useCallback(()=>{L(s)},[L,s]),Ge=D.useCallback(()=>{L(-s)},[L,s]),R=D.useCallback(()=>{q(w),P({x:0,y:0}),C.current=!1},[w]),Pe=D.useCallback(se=>{se.preventDefault();let we=se.deltaY>0?-s:s;L(we)},[L,s]),ze=D.useCallback(se=>{if(se.button!==0||se.isPrimary===!1)return;j(!0),C.current=!0,re({x:se.clientX,y:se.clientY}),le(G);let we=se.currentTarget;we instanceof HTMLElement&&we.setPointerCapture(se.pointerId)},[G]),De=D.useCallback(se=>{if(!K)return;se.preventDefault();let we=se.clientX-ce.x,Qe=se.clientY-ce.y;P({x:Y.x+we,y:Y.y+Qe})},[K,ce,Y]),We=D.useCallback(se=>{j(!1);let we=se.currentTarget;we instanceof HTMLElement&&we.releasePointerCapture(se.pointerId)},[]);D.useEffect(()=>{O(a),o||(H(l),q(l),_e(null))},[l,o,a]),D.useLayoutEffect(()=>{if(!(o&&r))return;qe(r);let se=T.current;if(!se||typeof ResizeObserver>"u")return;let we=new ResizeObserver(()=>{qe(r)});return we.observe(se),()=>{we.disconnect()}},[qe,r,o]),D.useEffect(()=>{o&&(C.current=!1)},[n,o]),D.useEffect(()=>{let se=T.current;if(se)return se.addEventListener("wheel",Pe,{passive:!1}),()=>{se.removeEventListener("wheel",Pe)}},[Pe]),D.useEffect(()=>{let se=k.current;if(se&&K)return document.body.style.userSelect="none",se.addEventListener("pointermove",De,{passive:!1}),se.addEventListener("pointerup",We),se.addEventListener("pointercancel",We),()=>{document.body.style.userSelect="",se.removeEventListener("pointermove",De),se.removeEventListener("pointerup",We),se.removeEventListener("pointercancel",We)}},[K,De,We]);let Xe=!c&&o&&xe!=null?{height:xe}:void 0;return I.jsxs("div",{className:b("relative flex flex-col",c?"h-full w-full":"min-h-28 w-full",t),ref:T,style:{cursor:K?"grabbing":"grab",...Xe},children:[u?I.jsxs("div",{className:b("absolute z-10 flex flex-col gap-1 rounded-md border border-border bg-background/80 p-1 supports-[backdrop-filter]:bg-background/70 supports-[backdrop-filter]:backdrop-blur-sm",c?"bottom-4 left-4":"bottom-2 left-2"),children:[I.jsx("button",{"aria-label":E.zoomIn,className:b("flex items-center justify-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50"),disabled:U>=i,onClick:Ie,title:E.zoomIn,type:"button",children:I.jsx(f,{"aria-hidden":"true",size:16})}),I.jsx("button",{"aria-label":E.zoomOut,className:b("flex items-center justify-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50"),disabled:U<=z,onClick:Ge,title:E.zoomOut,type:"button",children:I.jsx(p,{"aria-hidden":"true",size:16})}),I.jsx("button",{"aria-label":E.resetView,className:b("flex items-center justify-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground"),onClick:R,title:E.resetView,type:"button",children:I.jsx(h,{"aria-hidden":"true",size:16})})]}):null,I.jsx("div",{className:b("flex h-full w-full flex-1 origin-center items-center justify-center transition-transform duration-150 ease-out"),onPointerDown:ze,ref:k,role:"application",style:{transform:`translate(${G.x}px, ${G.y}px) scale(${U})`,transformOrigin:"center center",touchAction:"none",willChange:"transform"},children:e})]})},pS=(e,t)=>new Promise(r=>{let n=setTimeout(r,e);t(()=>{clearTimeout(n),r()})}),gS=async(e,{chart:t,config:r},n)=>{try{let a=e.getMermaid(r),i=t.split("").reduce((o,c)=>(o<<5)-o+c.charCodeAt(0)|0,0),s=`mermaid-${Math.abs(i)}-${Date.now()}-${Math.random().toString(36).substring(2,9)}`,{svg:u}=await a.render(s,t),l=Jm(u);return{ok:!0,svg:n?u:YA(u),size:l}}catch(a){return{ok:!1,error:a instanceof Error?a.message:"Failed to render Mermaid chart"}}},Up=({chart:e,className:t,config:r,fullscreen:n=!1,showControls:a=!0})=>{let i=ve(),[s,u]=D.useState(null),[l,o]=D.useState(!1),[c,h]=D.useState(""),[f,p]=D.useState(null),[b,E]=D.useState(""),[T,k]=D.useState(0),{mermaid:C}=D.useContext(ut),w=_l(),H=C==null?void 0:C.errorComponent,{shouldRender:z,containerRef:O}=Xw({immediate:n}),U=D.useRef(null),q=D.useRef(!1),G=D.useRef(!1),P=Gm(),K=D.useRef(P),j=D.useRef(null);D.useEffect(()=>(G.current=!0,()=>{var Y;G.current=!1,(Y=j.current)==null||Y.call(j)}),[]),D.useEffect(()=>{var Y;K.current=P,P||(Y=j.current)==null||Y.call(j)},[P]);let ce=async Y=>{K.current&&(await pS(Y,le=>{j.current=le}),j.current=null)};if(D.useEffect(()=>{if(!z)return;if(!w){u("Mermaid plugin not available. Please add the mermaid plugin to enable diagram rendering.");return}if(U.current={chart:e,config:r},q.current)return;let Y=(le,xe)=>{xe.ok?(h(xe.svg),p(xe.size),E(xe.svg)):le===U.current&&u(xe.error)};(async()=>{q.current=!0,u(null),o(!0);try{let le=U.current;for(;le;){let xe=performance.now(),_e=await gS(w,le,n);if(!G.current||(Y(le,_e),_e.ok&&await ce(performance.now()-xe),!G.current||le===U.current))return;le=U.current}}finally{q.current=!1,G.current&&o(!1)}})()},[e,r,T,z,w]),!(z||c||b))return I.jsx("div",{className:i("my-4 min-h-[200px]",t),ref:O});if(l&&!c&&!b)return I.jsx("div",{className:i("my-4 flex justify-center p-4",t),ref:O,children:I.jsxs("div",{className:i("flex items-center space-x-2 text-muted-foreground"),children:[I.jsx("div",{className:i("h-4 w-4 animate-spin rounded-full border-current border-b-2")}),I.jsx("span",{className:i("text-sm"),children:"Loading diagram..."})]})});if(s&&!c&&!b){let Y=()=>k(le=>le+1);return H?I.jsx("div",{ref:O,children:I.jsx(H,{chart:e,error:s,retry:Y})}):I.jsxs("div",{className:i("rounded-md bg-red-50 p-4",t),ref:O,children:[I.jsxs("p",{className:i("font-mono text-red-700 text-sm"),children:["Mermaid Error: ",s]}),I.jsxs("details",{className:i("mt-2"),children:[I.jsx("summary",{className:i("cursor-pointer text-red-600 text-xs"),children:"Show Code"}),I.jsx("pre",{className:i("mt-2 overflow-x-auto rounded bg-red-100 p-2 text-red-800 text-xs"),children:e})]})]})}let re=c||b;return I.jsx("div",{className:i(n?"size-full":"max-h-[min(70vh,40rem)] w-full",t),"data-streamdown":"mermaid",ref:O,children:I.jsx(mS,{className:i(n?"size-full overflow-hidden":"max-h-[min(70vh,40rem)] overflow-hidden",t),contentSize:f,fitKey:e,fullscreen:n,isAutoFit:!0,maxZoom:3,minZoom:.1,showControls:a,zoomStep:.1,children:I.jsx("div",{"aria-label":"Mermaid chart",className:i("flex justify-center",n?"size-full items-center":null),dangerouslySetInnerHTML:{__html:re},role:"img"})})})};const bS={code:t3,math:Q5},[xS,ES]=Xn.harden,yS=[Xn.raw,Xn.sanitize,[xS,{...ES,allowedImagePrefixes:[],allowDataImages:!1}]];function TS(e){return I.jsx($p,{plugins:bS,rehypePlugins:yS,...e})}const LS=Object.freeze(Object.defineProperty({__proto__:null,default:TS},Symbol.toStringTag,{value:"Module"})),vS=Object.freeze(Object.defineProperty({__proto__:null,Mermaid:Up},Symbol.toStringTag,{value:"Module"}));export{NS as F,ut as S,xA as a,LS as m};
|